:root {
  color-scheme: dark;
  --bg: #080d16 !important;
  --bg-deep: #060a11 !important;
  --sidebar: #0b1220 !important;
  --panel: #0d1724 !important;
  --panel-hover: #132034 !important;
  --panel-soft: #09121e !important;
  --surface-strong: #111e2e !important;
  --surface-input: #070f1a !important;
  --border: #203044 !important;
  --border-soft: #172435 !important;
  --border-bright: #344a63 !important;
  --text: #e3eaf3 !important;
  --text-primary: #f5f8fc !important;
  --text-soft: #aab8ca !important;
  --muted: #7f8da2 !important;
  --muted-2: #64738a !important;
  --blue: #5b9dff !important;
  --blue-soft: rgba(91, 157, 255, 0.12) !important;
  --amber: #eab308 !important;
  --amber-soft: rgba(234, 179, 8, 0.1) !important;
  --green: #32c98a !important;
  --green-soft: rgba(50, 201, 138, 0.1) !important;
  --red: #f06676 !important;
  --red-soft: rgba(240, 102, 118, 0.1) !important;
  --line: var(--border) !important;
  --panel2: var(--surface-strong) !important;
  --accent: var(--blue) !important;
  --yellow: var(--amber) !important;
  --success: var(--green) !important;
  --danger: var(--red) !important;
  --warning: var(--amber) !important;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f3 !important;
  --bg-deep: #e9edeb !important;
  --sidebar: #e7ece9 !important;
  --panel: #ffffff !important;
  --panel-hover: #f5f7f6 !important;
  --panel-soft: #f7f9f8 !important;
  --surface-strong: #edf1ef !important;
  --surface-input: #ffffff !important;
  --border: #d5ddda !important;
  --border-soft: #e2e8e5 !important;
  --border-bright: #bac7c1 !important;
  --text: #26312d !important;
  --text-primary: #17211d !important;
  --text-soft: #46534d !important;
  --muted: #65736d !important;
  --muted-2: #89948f !important;
  --blue: #2868c8 !important;
  --blue-soft: rgba(40, 104, 200, 0.1) !important;
  --amber: #806b00 !important;
  --amber-soft: rgba(128, 107, 0, 0.1) !important;
  --green: #105735 !important;
  --green-soft: rgba(16, 87, 53, 0.1) !important;
  --red: #8c2734 !important;
  --red-soft: rgba(140, 39, 52, 0.1) !important;
  --bg-gradient: linear-gradient(
    180deg,
    #f7f9f8 0%,
    #f0f3f1 55%,
    #e9edeb 100%
  ) !important;
  --accent: var(--blue) !important;
  --yellow: var(--amber) !important;
  --success: var(--green) !important;
  --danger: var(--red) !important;
  --warning: var(--amber) !important;
}

html body {
  color: var(--text) !important;
  background: var(--bg) !important;
}

html[data-theme="light"] body {
  background: var(--bg-gradient) !important;
}

html body .app {
  color: var(--text) !important;
  background: var(--bg) !important;
}

html body .app :is(
  .panel,
  [class$="-panel"],
  .card,
  [class$="-card"],
  .data-record,
  .section-card
) {
  color: var(--text) !important;
  background: var(--panel) !important;
  border-color: var(--border) !important;
}

html body .app :is(.topbar, .mobile-bottom-nav, .topbar-menu-panel) {
  color: var(--text);
  background: var(--sidebar);
  border-color: var(--border);
}

html body .app :is(input, select, textarea) {
  color: var(--text-primary) !important;
  background: var(--surface-input) !important;
  border-color: var(--border) !important;
}

html body .app :is(input, select, textarea)::placeholder {
  color: var(--muted) !important;
}

html body .app .nav button.active,
html body .app .mobile-bottom-nav-item.active {
  color: var(--blue) !important;
  background: var(--blue-soft) !important;
  border-color: var(--border) !important;
}

html body .app .gradient-text {
  color: var(--blue) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html body .app #welcomeView .searchbox {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

html body .app #welcomeView .searchbox:focus-within {
  border-color: var(--blue);
}

html body .app #welcomeView .search-submit {
  color: #fff;
  background: #2868c8;
  border-color: #3978d4;
}

html body .app #welcomeView .popular-asset {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

html body .app #welcomeView .popular-asset:hover {
  background: var(--panel-hover);
  border-color: var(--border-bright);
}

html body .app :is(.popular-assets-heading, .section-head h2, .page-heading h1) {
  color: var(--text-primary);
}

html body .app :is(table th, table td, .table-wrap, .table-container) {
  border-color: var(--border) !important;
}

html body .app table th {
  color: var(--muted) !important;
  background: var(--panel-soft) !important;
}

html body .app :is(a, button, input, select, textarea):focus-visible {
  outline-color: var(--blue) !important;
}

html body.market-site {
  color: var(--text) !important;
  background: var(--bg-deep) !important;
}

html[data-theme="light"] body.market-site {
  background: var(--bg-gradient) !important;
}

html body.market-site :is(.site-header, .topbar) {
  color: var(--text);
  background: var(--sidebar);
  border-color: var(--border);
}

html body.market-site :is(
  .card,
  [class$="-card"],
  .panel,
  [class$="-panel"],
  .faq-item
) {
  color: var(--text) !important;
  background: var(--panel) !important;
  border-color: var(--border) !important;
}

html body.market-site :is(input, select, textarea) {
  color: var(--text-primary) !important;
  background: var(--surface-input) !important;
  border-color: var(--border) !important;
}

html body.market-site :is(h1, h2, h3, .page-title) {
  color: var(--text-primary);
}

html body.market-site footer {
  color: var(--muted);
  border-color: var(--border);
}
