:root {
  --tp-page: #fffdf7;
  --tp-surface: #ffffff;
  --tp-ink: #0f172a;
  --tp-muted: #475569;
  --tp-line: #e2e8f0;
  /* QuantDinger updates these primary tokens when the user switches theme. */
  --tp-gold: var(--primary-color, #faad14);
  --tp-gold-light: var(--primary-color-hover, #fbbf48);
  --tp-gold-pale: var(--primary-color-soft-strong, rgba(250, 173, 20, 0.18));
  --tp-gold-deep: var(--primary-color-active, #dc9812);
  --tp-accent-soft: var(--primary-color-soft, rgba(250, 173, 20, 0.1));
  --tp-accent-ring: var(--primary-color-ring, rgba(250, 173, 20, 0.22));
  --tp-on-accent: #0f172a;
  accent-color: var(--tp-gold);
}

body::before {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10000;
  height: 3px;
  background: linear-gradient(90deg, var(--tp-gold-light), var(--tp-gold), var(--tp-gold-deep));
  content: "";
  pointer-events: none;
}

.ant-pro-basicLayout,
.ant-pro-basicLayout-content,
.ant-layout,
.ant-layout-content {
  background-color: var(--tp-page) !important;
}

.ant-pro-top-nav-header,
.ant-pro-global-header,
.ant-pro-basicLayout .ant-layout-header:not(.ant-pro-top-menu) {
  border-bottom: 1px solid var(--tp-accent-ring);
  background: #ffffff !important;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.06) !important;
}

html[data-tradepulse-brand="active"] body .ant-layout-header.ant-pro-fixed-header.ant-pro-top-menu,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header-main,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header-left,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header-logo,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header-menu,
html[data-tradepulse-brand="active"] body .ant-pro-global-header-index-right,
html[data-tradepulse-brand="active"] body .ant-pro-top-nav-header .ant-menu-horizontal {
  background: #ffffff !important;
}

.ant-pro-top-nav-header-logo {
  width: 286px !important;
  overflow: hidden !important;
}

.tp-shell-brand,
.tp-login-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
  color: var(--tp-ink) !important;
  text-decoration: none !important;
}

.tp-shell-brand .sidebar-logo-wrapper {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
}

.tp-shell-brand .tp-brand-mark {
  width: 52px !important;
  height: 38px !important;
  object-fit: contain !important;
}

.tp-brand-copy {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
}

.tp-brand-title {
  color: var(--tp-ink);
  font-size: 16px;
  font-weight: 400;
}

.tp-brand-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 400;
}

.tp-brand-heading {
  color: var(--tp-ink) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
}

html[data-tradepulse-brand="active"] .antd-pro-global-header-index-avatar.ant-avatar.ant-avatar-image {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border: 1px solid var(--tp-gold) !important;
  background: linear-gradient(135deg, var(--tp-gold-pale), var(--tp-gold-light), var(--tp-gold)) !important;
  box-shadow: 0 3px 10px var(--tp-accent-ring) !important;
}

html[data-tradepulse-brand="active"] .antd-pro-global-header-index-avatar.ant-avatar.ant-avatar-image > img.tp-default-avatar {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: scale(1.24) !important;
  transform-origin: center !important;
}

.ant-menu-horizontal > .ant-menu-item-selected,
.ant-menu-horizontal > .ant-menu-submenu-selected,
.ant-menu-item-selected,
.ant-menu-submenu-selected > .ant-menu-submenu-title,
.ant-tabs-tab-active,
.ant-tabs-tab:hover {
  color: var(--tp-gold-deep) !important;
}

.ant-menu-horizontal > .ant-menu-item:hover,
.ant-menu-horizontal > .ant-menu-submenu:hover,
.ant-menu-horizontal > .ant-menu-item-selected,
.ant-menu-horizontal > .ant-menu-submenu-selected {
  border-color: var(--tp-gold) !important;
}

.ant-tabs-ink-bar {
  background-color: var(--tp-gold) !important;
}

.ant-menu-item-selected .anticon,
.ant-menu-submenu-selected .anticon,
.ant-tabs-tab-active .anticon,
.ant-btn-link:not(.ant-btn-dangerous):not(.ant-btn-danger) {
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-selected,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-active,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item:hover,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-selected,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-active,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu:hover,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-selected > a,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-selected > .ant-menu-submenu-title,
html[data-tradepulse-brand="active"] body .ant-tabs .ant-tabs-tab-active,
html[data-tradepulse-brand="active"] body .ant-tabs .ant-tabs-tab-active .anticon {
  border-bottom-color: var(--tp-gold) !important;
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-selected *,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-active *,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item:hover *,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-selected > .ant-menu-submenu-title *,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-active > .ant-menu-submenu-title *,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu:hover > .ant-menu-submenu-title * {
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-item.ant-menu-item-selected::after,
html[data-tradepulse-brand="active"] body .ant-menu.ant-menu-horizontal > .ant-menu-submenu.ant-menu-submenu-selected::after,
html[data-tradepulse-brand="active"] body .ant-tabs .ant-tabs-ink-bar {
  border-color: var(--tp-gold) !important;
  background-color: var(--tp-gold) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu:not(.ant-menu-horizontal) .ant-menu-item.ant-menu-item-selected {
  background: var(--tp-accent-soft) !important;
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu:not(.ant-menu-horizontal) .ant-menu-item.ant-menu-item-selected > a,
html[data-tradepulse-brand="active"] body .ant-menu:not(.ant-menu-horizontal) .ant-menu-item.ant-menu-item-selected .anticon {
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-menu:not(.ant-menu-horizontal) .ant-menu-item.ant-menu-item-selected::after {
  border-color: var(--tp-gold) !important;
}

html[data-tradepulse-brand="active"] body .copilot-workbench,
html[data-tradepulse-brand="active"] body .quick-tools-modal {
  --qd-accent: var(--tp-gold) !important;
  --qd-accent-soft: var(--tp-accent-soft) !important;
  --qd-accent-weak: var(--tp-accent-soft) !important;
  --qd-accent-border: var(--tp-gold-light) !important;
  --qd-accent-ring: var(--tp-accent-ring) !important;
}

html[data-tradepulse-brand="active"] body .copilot-workbench .eyebrow,
html[data-tradepulse-brand="active"] body .copilot-workbench .task-icon,
html[data-tradepulse-brand="active"] body .quick-tools-modal .task-icon {
  border-color: var(--tp-gold-light) !important;
  background: var(--tp-accent-soft) !important;
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .copilot-workbench .task-icon .anticon,
html[data-tradepulse-brand="active"] body .quick-tools-modal .task-icon .anticon {
  color: inherit !important;
}

html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-task:hover,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-task:focus-visible,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-prompts button:hover,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-prompts button:focus-visible,
html[data-tradepulse-brand="active"] body .quick-tools-modal .welcome-task:hover,
html[data-tradepulse-brand="active"] body .quick-tools-modal .welcome-task:focus-visible {
  border-color: var(--tp-gold) !important;
  background: linear-gradient(135deg, #ffffff, var(--tp-accent-soft)) !important;
  box-shadow: 0 12px 28px var(--tp-accent-ring) !important;
}

html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-task:hover .task-icon,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-task:focus-visible .task-icon,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-prompts button:hover .task-icon,
html[data-tradepulse-brand="active"] body .copilot-workbench .welcome-prompts button:focus-visible .task-icon,
html[data-tradepulse-brand="active"] body .quick-tools-modal .welcome-task:hover .task-icon,
html[data-tradepulse-brand="active"] body .quick-tools-modal .welcome-task:focus-visible .task-icon {
  border-color: var(--tp-gold) !important;
  background: linear-gradient(135deg, var(--tp-gold-light), var(--tp-gold)) !important;
  color: var(--tp-on-accent) !important;
}

.ant-btn-primary:not(.ant-btn-dangerous):not(.ant-btn-danger) {
  border-color: var(--tp-gold) !important;
  background: linear-gradient(90deg, var(--tp-gold-light), var(--tp-gold)) !important;
  color: var(--tp-on-accent) !important;
  box-shadow: 0 8px 20px var(--tp-accent-ring) !important;
}

.ant-btn-primary:not(.ant-btn-dangerous):not(.ant-btn-danger):hover,
.ant-btn-primary:not(.ant-btn-dangerous):not(.ant-btn-danger):focus {
  border-color: var(--tp-gold-deep) !important;
  background: linear-gradient(90deg, var(--tp-gold), var(--tp-gold-deep)) !important;
  color: var(--tp-on-accent) !important;
}

.ant-input:focus,
.ant-input-focused,
.ant-input-affix-wrapper:focus,
.ant-input-affix-wrapper-focused,
.ant-select-focused .ant-select-selection,
.ant-pagination-item-active {
  border-color: var(--tp-gold) !important;
  box-shadow: 0 0 0 2px var(--tp-accent-ring) !important;
}

.ant-checkbox-checked .ant-checkbox-inner,
.ant-radio-inner::after,
.ant-switch-checked {
  border-color: var(--tp-gold) !important;
  background-color: var(--tp-gold) !important;
}

.ant-pagination-item-active a,
.ant-breadcrumb a:hover {
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-dropdown-menu.ant-pro-header-menu .ant-dropdown-menu-item-selected,
html[data-tradepulse-brand="active"] body .ant-dropdown-menu.ant-pro-header-menu .ant-dropdown-menu-item:hover {
  border-color: var(--tp-gold) !important;
  background: var(--tp-accent-soft) !important;
  color: var(--tp-gold-deep) !important;
}

html[data-tradepulse-brand="active"] body .ant-dropdown-menu.ant-pro-header-menu .ant-dropdown-menu-item-selected *,
html[data-tradepulse-brand="active"] body .ant-dropdown-menu.ant-pro-header-menu .ant-dropdown-menu-item:hover * {
  color: inherit !important;
}

.user-layout-wrapper {
  background:
    radial-gradient(circle at 16% 12%, var(--tp-gold-pale), transparent 31%),
    radial-gradient(circle at 82% 10%, var(--tp-accent-soft), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, var(--tp-page) 56%, #f8fafc 100%) !important;
}

.user-layout-wrapper .container {
  background: transparent !important;
}

.user-layout-content .header {
  margin-bottom: 22px !important;
}

.user-layout-content .tp-login-brand {
  justify-content: center;
}

.user-layout-content .tp-login-brand .tp-brand-mark {
  width: 96px !important;
  height: 70px !important;
  object-fit: contain !important;
}

.user-layout-content .tp-brand-copy--login .tp-brand-title {
  font-size: 22px;
}

.user-layout-content .tp-brand-copy--login .tp-brand-subtitle {
  color: var(--tp-gold-deep);
  font-size: 11px;
}

.user-layout-content .main {
  border: 1px solid var(--tp-accent-ring);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

.user-layout-content .ant-input,
.user-layout-content .ant-input-affix-wrapper {
  background-color: #fffef9 !important;
}

.user-layout-content input:-webkit-autofill,
.user-layout-content input:-webkit-autofill:hover,
.user-layout-content input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fffef9 inset !important;
  -webkit-text-fill-color: var(--tp-ink) !important;
}

.user-layout-content .login-method-switch a.active,
.user-layout-content a:not(.tp-login-brand) {
  color: var(--tp-gold-deep) !important;
}

.user-layout-content .login-method-switch a.active {
  border-bottom-color: var(--tp-gold) !important;
}

.user-layout-content .login-method-switch a.active::after {
  border-color: var(--tp-gold) !important;
  background-color: var(--tp-gold) !important;
}

#quantdinger-mt5-broker-addon .mt5-icon {
  background: var(--tp-accent-soft) !important;
  color: var(--tp-gold-deep) !important;
}

#quantdinger-mt5-broker-addon button:hover,
#quantdinger-mt5-broker-addon .mt5-detail:hover {
  border-color: var(--tp-gold) !important;
  color: var(--tp-gold-deep) !important;
}

#quantdinger-mt5-broker-addon .mt5-detail {
  border-color: var(--tp-gold) !important;
  background: linear-gradient(90deg, var(--tp-gold-light), var(--tp-gold)) !important;
  color: var(--tp-on-accent) !important;
}

#quantdinger-mt5-broker-addon .mt5-tag {
  border-color: var(--tp-gold-light) !important;
  background: var(--tp-accent-soft) !important;
  color: var(--tp-gold-deep) !important;
}

@media (max-width: 860px) {
  .ant-pro-top-nav-header-logo {
    width: 76px !important;
  }

  .tp-brand-copy--shell {
    display: none;
  }
}

@media (max-width: 640px) {
  .user-layout-content .tp-login-brand {
    gap: 9px;
  }

  .user-layout-content .tp-login-brand .tp-brand-mark {
    width: 76px !important;
    height: 56px !important;
  }

  .user-layout-content .tp-brand-copy--login .tp-brand-title {
    font-size: 18px;
  }

  .user-layout-content .tp-brand-copy--login .tp-brand-subtitle {
    font-size: 10px;
  }
}
