.ai-trader-api-status {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 16px;
  z-index: 10000;
  padding: 12px 16px;
  border: 1px solid rgba(34, 197, 94, .42);
  border-radius: 16px;
  background: rgba(5, 46, 22, .92);
  color: #bbf7d0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  font: 600 13px/1.4 Inter, system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-trader-api-status[hidden] {
  display: none !important;
}

.ai-trader-api-status.is-error {
  border-color: rgba(248, 113, 113, .4);
  background: rgba(69, 10, 10, .92);
  color: #fecaca;
}

.ai-trader-api-status.is-success {
  border-color: rgba(34, 197, 94, .42);
  background: rgba(5, 46, 22, .92);
  color: #bbf7d0;
}

.ai-trader-api-status__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  cursor: pointer;
  font: 800 18px/1 Inter, system-ui, sans-serif;
}

.ai-trader-api-status__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

body[data-ai-auth-state="pending"] .ai-protected-content,
body[data-ai-auth-state="auth-failed"] .ai-protected-content,
body[data-ai-backend-state="pending"] .ai-protected-content,
body[data-ai-backend-state="auth-failed"] .ai-protected-content,
body[data-ai-backend-state="error"] .ai-protected-content,
body[data-ai-auth-state="pending"] .balance,
body[data-ai-auth-state="auth-failed"] .balance,
body[data-ai-backend-state="pending"] .balance,
body[data-ai-backend-state="auth-failed"] .balance,
body[data-ai-backend-state="error"] .balance {
  display: none !important;
}

body[data-ai-backend-state="pending"] .ai-backend-content,
body[data-ai-backend-state="auth-failed"] .ai-backend-content,
body[data-ai-backend-state="error"] .ai-backend-content,
body[data-ai-backend-state="pending"] .active-sessions,
body[data-ai-backend-state="auth-failed"] .active-sessions,
body[data-ai-backend-state="error"] .active-sessions,
body[data-ai-backend-state="pending"] .history-card,
body[data-ai-backend-state="auth-failed"] .history-card,
body[data-ai-backend-state="error"] .history-card,
body[data-ai-backend-state="pending"] .session-dashboard,
body[data-ai-backend-state="auth-failed"] .session-dashboard,
body[data-ai-backend-state="error"] .session-dashboard,
body[data-ai-backend-state="pending"] .finance-hero-grid,
body[data-ai-backend-state="auth-failed"] .finance-hero-grid,
body[data-ai-backend-state="error"] .finance-hero-grid,
body[data-ai-backend-state="pending"] .finance-stats-grid,
body[data-ai-backend-state="auth-failed"] .finance-stats-grid,
body[data-ai-backend-state="error"] .finance-stats-grid,
body[data-ai-backend-state="pending"] .finance-history-section,
body[data-ai-backend-state="auth-failed"] .finance-history-section,
body[data-ai-backend-state="error"] .finance-history-section,
body[data-ai-backend-state="pending"] .withdraw-main-grid,
body[data-ai-backend-state="auth-failed"] .withdraw-main-grid,
body[data-ai-backend-state="error"] .withdraw-main-grid,
body[data-ai-backend-state="pending"] .withdraw-history-section,
body[data-ai-backend-state="auth-failed"] .withdraw-history-section,
body[data-ai-backend-state="error"] .withdraw-history-section,
body[data-ai-backend-state="pending"] .affiliate-stats-grid,
body[data-ai-backend-state="auth-failed"] .affiliate-stats-grid,
body[data-ai-backend-state="error"] .affiliate-stats-grid,
body[data-ai-backend-state="pending"] .affiliate-statistics-section,
body[data-ai-backend-state="auth-failed"] .affiliate-statistics-section,
body[data-ai-backend-state="error"] .affiliate-statistics-section,
body[data-ai-backend-state="pending"] .referral-link-section,
body[data-ai-backend-state="auth-failed"] .referral-link-section,
body[data-ai-backend-state="error"] .referral-link-section,
body[data-ai-backend-state="pending"] .bonus-leaderboard,
body[data-ai-backend-state="auth-failed"] .bonus-leaderboard,
body[data-ai-backend-state="error"] .bonus-leaderboard,
body[data-ai-backend-state="pending"] .tasks-section,
body[data-ai-backend-state="auth-failed"] .tasks-section,
body[data-ai-backend-state="error"] .tasks-section,
body[data-ai-backend-state="pending"] .referral-bonus-section,
body[data-ai-backend-state="auth-failed"] .referral-bonus-section,
body[data-ai-backend-state="error"] .referral-bonus-section {
  display: none !important;
}

.ai-backend-loading-state {
  width: min(960px, calc(100% - 32px));
  margin: 24px auto;
  padding: 18px 20px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .84), rgba(30, 41, 59, .66));
  color: #bfdbfe;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
  font: 700 14px/1.45 Inter, system-ui, sans-serif;
}

body[data-ai-backend-state="ready"] .ai-backend-loading-state,
body[data-ai-backend-state="auth-failed"] .ai-backend-loading-state,
body[data-ai-backend-state="error"] .ai-backend-loading-state,
body:not([data-ai-backend-state="error"]) .ai-backend-error-state {
  display: none !important;
}

.ai-backend-error-state {
  width: min(960px, calc(100% - 32px));
  margin: 24px auto;
  padding: 18px 20px;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 20px;
  background: rgba(69, 10, 10, .72);
  color: #fecaca;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  font: 700 14px/1.45 Inter, system-ui, sans-serif;
}

.ai-auth-required-notice {
  width: min(960px, calc(100% - 32px));
  margin: 24px auto;
  padding: 18px 20px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 20px;
  background: rgba(15, 23, 42, .88);
  color: #dbeafe;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .26);
  font-family: Inter, system-ui, sans-serif;
}

.ai-auth-required-notice strong {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 16px;
}

.ai-auth-required-notice span {
  display: block;
  color: #bfdbfe;
  font-size: 14px;
  line-height: 1.45;
}

body[data-ai-auth-state="active"] .ai-auth-required-notice {
  display: none !important;
}

.ai-trader-block-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(124, 58, 237, .18), transparent 40%), #07090d;
  color: #fff;
}

.ai-trader-block-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: 28px;
  background: rgba(15, 23, 42, .86);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.ai-trader-block-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, .14);
  color: #fca5a5;
  font-size: 28px;
  font-weight: 900;
}

.ai-trader-block-card h1 { margin: 0 0 10px; font-size: 26px; }
.ai-trader-block-card p { margin: 0; color: #cbd5e1; line-height: 1.55; }

.ai-trader-simple-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-height: 220px;
  height: 100%;
  padding: 20px 18px 28px;
}

.ai-trader-simple-chart span {
  flex: 1;
  min-width: 4px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #8b5cf6, #2563eb);
  box-shadow: 0 0 18px rgba(59, 130, 246, .2);
}

.ai-trader-simple-chart.balance span { background: linear-gradient(180deg, #38bdf8, #8b5cf6); }
.ai-trader-simple-chart.turnover span { background: linear-gradient(180deg, #22c55e, #2563eb); }

.finance-chart-no-data {
  min-height: 272px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, .24);
  border-radius: 22px;
  background: radial-gradient(circle at top, rgba(56, 189, 248, .08), transparent 46%), rgba(15, 23, 42, .34);
  color: rgba(226, 232, 240, .72);
  font: 700 15px/1.4 Inter, system-ui, sans-serif;
  text-align: center;
}
