:root {
  --bg: #f4f6f1;
  --panel: #ffffff;
  --ink: #18221d;
  --muted: #657067;
  --line: #d9dfd8;
  --accent: #176b5b;
  --accent-2: #c24e32;
  --gold: #d8a31d;
  --blue: #3767a5;
  --shadow: 0 18px 40px rgba(35, 45, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #10231f;
  color: #f7fbf6;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e1b238;
  color: #10231f;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sync-panel span,
.sync-panel small {
  color: #aebbb4;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.primary,
.secondary,
.icon-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: #d7e0dc;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sync-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.sync-panel strong {
  font-size: 13px;
  line-height: 1.4;
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-toggle {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: #fbfcfb;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.panel p,
.topbar p {
  color: var(--muted);
}

.primary,
.secondary {
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: #115346;
}

.secondary {
  color: var(--accent);
  background: #e6eee9;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 138px;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  font-size: 36px;
}

.metric.large strong {
  font-size: clamp(38px, 5vw, 58px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-panel canvas {
  width: 100%;
  height: 330px;
  display: block;
}

.breakdown {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef1ec;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.search,
input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
}

.search {
  width: min(340px, 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #174034;
  background: #dfece6;
  font-size: 12px;
  font-weight: 800;
}

.config-layout {
  display: grid;
  gap: 14px;
}

.form-list {
  display: grid;
  gap: 12px;
}

.form-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  display: grid;
  gap: 10px;
}

.row-top,
.row-fields {
  display: grid;
  grid-template-columns: 150px 1fr auto 36px;
  gap: 10px;
  align-items: center;
}

.row-fields {
  grid-template-columns: repeat(3, 1fr);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn {
  width: 36px;
  height: 36px;
  color: #8b3b2d;
  background: #f5e5df;
  font-size: 22px;
  line-height: 1;
}

.toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-grid label {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fbfcfb;
}

.save-btn {
  margin-top: 16px;
}

.snapshot-list {
  display: grid;
  gap: 8px;
}

.snapshot-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mini-line {
  height: 8px;
  border-radius: 999px;
  background: #e8eee8;
  overflow: hidden;
}

.mini-line span {
  display: block;
  height: 100%;
  background: var(--blue);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    flex-direction: column;
  }

  .row-top,
  .row-fields {
    grid-template-columns: 1fr;
  }
}

/* Dark workspace override */
:root {
  --bg: #090d12;
  --panel: #111923;
  --panel-2: #0d141d;
  --ink: #edf4f8;
  --muted: #8ea0ad;
  --line: #22303d;
  --accent: #21c7a8;
  --accent-2: #ff6b4a;
  --gold: #f4bd45;
  --blue: #6aa4ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.sidebar {
  background: #07110f;
}

.metric,
.panel,
.platform-group {
  background: var(--panel);
}

.filter-toggle,
input,
select,
.form-row,
.toggle-grid label {
  background: var(--panel-2);
  color: var(--ink);
}

.secondary {
  background: #102b28;
}

.bar-track,
.mini-line {
  background: #182330;
}

.icon-btn {
  background: #321b19;
}

.platform-groups {
  display: grid;
  gap: 10px;
}

.platform-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.platform-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.platform-button strong,
.platform-button span {
  display: block;
}

.platform-button small,
.asset-line small {
  color: var(--muted);
}

.platform-total {
  font-weight: 800;
  color: var(--accent);
}

.platform-chevron {
  color: var(--muted);
}

.platform-detail {
  display: none;
  border-top: 1px solid var(--line);
  padding: 4px 14px 12px;
}

.platform-group.open .platform-detail {
  display: block;
}

.asset-line {
  display: grid;
  grid-template-columns: 90px minmax(130px, 1fr) 120px 110px 130px minmax(160px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(142, 160, 173, 0.14);
}

.asset-line:last-child {
  border-bottom: 0;
}

.custom-row-top {
  grid-template-columns: 1fr 1fr 140px auto 36px;
}

.wallet-row-top {
  grid-template-columns: 1fr auto 36px;
}

.debank-fields {
  grid-template-columns: minmax(280px, 1fr);
}

.platform-detail.asset-logo-grid {
  padding: 14px;
}

.platform-group.open .asset-logo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.asset-tile {
  min-width: 0;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid rgba(142, 160, 173, 0.16);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 6px 8px;
  background: #0a1119;
}

.asset-logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #06100e;
  background: var(--logo-bg);
  font-size: 9px;
  font-weight: 900;
}

.asset-tile-main {
  min-width: 0;
  align-self: center;
}

.asset-tile-main strong,
.asset-tile-main small,
.asset-tile-value,
.asset-tile-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-tile-main strong {
  display: block;
  font-size: 13px;
}

.asset-tile-value {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 900;
  color: var(--accent);
}

.asset-tile-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

/* PS mockup layout */
:root {
  --bg: #03050a;
  --sidebar: #001611;
  --sidebar-soft: #061c17;
  --panel: #101a24;
  --panel-2: #07120f;
  --ink: #f3f7f6;
  --muted: #9eacb6;
  --line: #233746;
  --accent: #23ccb9;
  --summary: #5c8968;
  --gold: #e6b63d;
  --shadow: none;
}

body {
  background: var(--bg);
  color: var(--ink);
}

.app-shell {
  grid-template-columns: 288px 1fr;
}

.sidebar {
  padding: 24px;
  background: linear-gradient(90deg, var(--sidebar) 0%, var(--sidebar-soft) 100%);
  gap: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--gold);
  color: #001611;
}

.nav-item {
  min-height: 45px;
  padding: 0 14px;
  font-size: 16px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
}

.sync-panel {
  padding: 16px;
  gap: 9px;
  border-color: rgba(255, 255, 255, 0.14);
}

.sync-panel span {
  color: #b8c7c3;
}

.sync-panel strong {
  font-size: 14px;
  color: #ffffff;
}

.primary {
  background: #2ccbb4;
}

.primary:hover {
  background: #25b9a4;
}

main {
  width: calc(100vw - 330px);
  max-width: none;
  padding: 38px 42px;
}

.topbar {
  display: none;
}

#overview.view.active {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.metric-grid {
  order: 1;
  display: block;
  margin: 0;
}

.metric {
  display: none;
}

.metric.large {
  width: 393px;
  min-height: 82px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  align-content: center;
  gap: 0 18px;
  background: var(--summary);
}

.metric.large span {
  grid-column: 1 / -1;
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.metric.large strong {
  font-size: 34px;
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: 0;
}

.metric.large small {
  justify-self: end;
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

#overview > .panel {
  order: 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#overview > .panel .panel-head {
  margin: 0 0 18px 14px;
  display: block;
}

#overview > .panel .panel-head h2,
.chart-panel h2 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

#overview > .panel .panel-head p,
#overview > .panel .search {
  display: none;
}

.table-wrap {
  overflow: visible;
}

.platform-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 26px 28px;
  width: 100%;
}

.portfolio-card {
  border: 0;
  padding: 0;
  width: 112px;
  flex: 0 0 112px;
  display: grid;
  gap: 12px;
  justify-items: center;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
}

.portfolio-card h3 {
  width: 112px;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-card strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.portfolio-logo {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: #050608;
}

.portfolio-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dashboard-grid {
  order: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  margin: 26px 0 0;
}

.dashboard-grid > .panel:not(.chart-panel) {
  display: block;
  height: 443px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.chart-panel {
  width: auto;
  max-width: 100%;
  height: 443px;
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.chart-panel .panel-head {
  display: block;
  margin: 0 0 18px;
}

.chart-panel .panel-head p {
  margin: 6px 0 0;
  color: #9eb9d8;
  font-size: 15px;
}

.chart-panel canvas {
  height: 338px;
}

.breakdown {
  gap: 18px;
}

.bar-label {
  color: #d9e5e8;
}

.bar-track {
  height: 8px;
  background: #20303d;
}

.bar-fill {
  background: linear-gradient(90deg, #23ccb9, #5c8968);
}

.asset-modal[hidden] {
  display: none;
}

.asset-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.asset-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.asset-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 48px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1923;
  transform: translate(-50%, -50%);
  overflow: auto;
}

.asset-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: #1c2a36;
  font-size: 22px;
  cursor: pointer;
}

.asset-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.asset-modal-head img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-modal-head h2 {
  margin: 0 0 4px;
}

.asset-modal-head p {
  margin: 0;
  color: var(--muted);
}

.detail-assets {
  display: grid;
  gap: 10px;
}

.detail-section-title {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px 16px;
  padding: 14px;
  border: 1px solid rgba(142, 160, 173, 0.16);
  border-radius: 8px;
  background: #0b131b;
}

.detail-row strong,
.detail-row span {
  display: block;
}

.detail-row span,
.detail-row p {
  color: var(--muted);
  font-size: 13px;
}

.detail-row p {
  grid-column: 1 / -1;
  margin: 0;
}

.position-row {
  border-color: rgba(45, 203, 180, 0.28);
  background: rgba(45, 203, 180, 0.05);
}

.positive {
  color: #31cfb7;
}

.negative {
  color: #ff7a59;
}

.config-layout,
#snapshots .panel {
  margin-top: 0;
}

.empty-state {
  padding: 20px 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  main {
    width: 100%;
    padding: 24px;
  }

  .metric.large,
  .chart-panel {
    width: 100%;
  }

  .platform-groups {
    gap: 24px 24px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > .panel:not(.chart-panel) {
    height: auto;
  }
}


#funding.view.active {
  display: block;
}

.funding-metrics {
  margin-bottom: 14px;
}

.funding-dashboard-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.funding-form {
  display: grid;
  gap: 10px;
}

.funding-form input,
.funding-form select,
.funding-form button {
  width: 100%;
}

.funding-wallets {
  display: grid;
  gap: 14px;
}

.funding-wallet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-2);
}

.funding-wallet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.funding-wallet-head h3,
.funding-wallet-head p,
.funding-columns h4 {
  margin: 0;
}

.funding-wallet-head p {
  color: var(--muted);
  font-size: 13px;
}

.funding-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.funding-columns section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.funding-columns h4 {
  color: var(--muted);
  font-size: 13px;
}

.funding-row {
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(142, 160, 173, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funding-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.funding-row strong {
  white-space: nowrap;
}

.funding-list.compact {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
}

.positive {
  color: #23ccb9;
}

.negative {
  color: #ff6b4a;
}

@media (max-width: 980px) {
  .funding-dashboard-grid,
  .funding-columns {
    grid-template-columns: 1fr;
  }
}


.wallet-funding-chart-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.wallet-funding-chart-wrap h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wallet-funding-chart {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid rgba(142, 160, 173, 0.14);
  border-radius: 8px;
  background: #111923;
}

.funding-accordion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.funding-accordion {
  min-width: 0;
  border: 1px solid rgba(142, 160, 173, 0.16);
  border-radius: 8px;
  background: #0a1119;
  overflow: hidden;
}

.funding-accordion-toggle {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.funding-accordion-body {
  display: none;
  padding: 0 12px 10px;
  border-top: 1px solid rgba(142, 160, 173, 0.14);
}

.funding-accordion.open .funding-accordion-body {
  display: block;
}

.funding-accordion.open .funding-accordion-toggle span {
  transform: rotate(45deg);
}

@media (max-width: 980px) {
  .funding-accordion-grid {
    grid-template-columns: 1fr;
  }
}


.wallet-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.funding-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.funding-popup-trigger {
  min-height: 42px;
  border: 1px solid rgba(142, 160, 173, 0.2);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #0a1119;
  cursor: pointer;
  font-weight: 800;
}

.funding-popup-trigger:hover {
  border-color: var(--accent);
}

.funding-popup[hidden] {
  display: none;
}

.funding-popup {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.funding-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.funding-popup-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 64px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: #101a24;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.funding-popup-panel h3 {
  margin: 0 36px 14px 0;
  font-size: 18px;
}

@media (max-width: 980px) {
  .wallet-chart-grid {
    grid-template-columns: 1fr;
  }
}


#funding .funding-wide-chart {
  width: 100%;
  margin-bottom: 14px;
}

#funding .funding-wide-chart canvas {
  height: 380px;
}

.custom-funding-card {
  margin-bottom: 14px;
}

.custom-funding-toggle {
  width: 100%;
  min-height: 48px;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.custom-funding-toggle span::after {
  content: "?";
  margin-left: 10px;
  color: var(--muted);
}

.custom-funding-card.collapsed .custom-funding-toggle span::after {
  content: "+";
}

.custom-funding-body {
  padding-top: 14px;
  border-top: 1px solid rgba(142, 160, 173, 0.14);
}

.custom-funding-card.collapsed .custom-funding-body {
  display: none;
}

.custom-funding-card .panel-head {
  margin-bottom: 12px;
}

/* Funding page spacing fix */
#funding.view.active {
  display: flex !important;
  flex-direction: column;
  gap: 22px;
  align-items: stretch;
  padding-bottom: 48px;
}

#funding .funding-metrics,
#funding .funding-wide-chart,
#funding .custom-funding-card,
#funding > .panel {
  width: 100%;
  margin: 0;
  position: relative;
  z-index: 0;
  box-sizing: border-box;
}

#funding .funding-wide-chart {
  min-height: 520px;
  padding-bottom: 26px;
  overflow: visible;
}

#funding .funding-wide-chart .panel-head {
  margin-bottom: 20px;
}

#funding #fundingChart {
  width: 100%;
  height: 390px !important;
  display: block;
  margin: 0;
}

#funding .custom-funding-card {
  clear: both;
  margin-top: 0;
}

#funding .custom-funding-toggle span::after {
  content: "-";
}

#funding .custom-funding-card.collapsed .custom-funding-toggle span::after {
  content: "+";
}

/* Funding popup hourly details */
.funding-popup-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 42px 14px 0;
}

.funding-popup-title-row h3 {
  margin: 0;
  font-size: 18px;
}

#fundingPopupTotal {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 16px;
  line-height: 1.4;
  padding-top: 1px;
  white-space: nowrap;
  text-align: right;
}

.funding-hour-row > span {
  min-width: 0;
}

.funding-platform-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.funding-platform-line {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.funding-platform-line em {
  font-style: normal;
  color: var(--muted);
}

.funding-platform-line strong {
  font-size: 13px;
}


/* Funding page stable ordering */
#funding.view.active {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  gap: 22px;
}

#funding #fundingMetrics {
  order: -100;
  margin: 0 0 4px;
}

#funding .funding-total-card {
  order: -101;
}

#funding .funding-wide-chart {
  order: -80;
}

#funding .custom-funding-card {
  order: -70;
}

#funding .funding-wallet-panel {
  order: -90;
}


/* Custom funding quick time */
.quick-time-field {
  display: grid;
  gap: 8px;
}

.quick-time-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-time-actions button {
  width: auto;
  min-height: 34px;
  border: 1px solid rgba(142, 160, 173, 0.24);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #0a1119;
  font-weight: 800;
  cursor: pointer;
}

.quick-time-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* Fast custom funding delete feedback */
.funding-row.removing {
  opacity: 0.45;
  transform: translateX(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.funding-row .icon-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}


/* Highlight largest hourly funding total */
.funding-hour-row-top {
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(49, 207, 183, 0.1);
}

.funding-hour-row-top > strong {
  font-size: 18px;
  font-weight: 950;
}

.funding-hour-row-top > span {
  color: var(--ink);
  font-weight: 850;
}

/* Compact recent funding popup */
.funding-popup {
  padding: 12px;
}

.funding-popup-panel {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 14px 16px;
}

.funding-popup-title-row {
  margin: 0 40px 8px 0;
}

.funding-popup-title-row h3 {
  font-size: 17px;
}

#fundingPopupTotal {
  font-size: 15px;
}

.funding-popup-panel .funding-row {
  min-height: 0;
  padding: 5px 0;
  gap: 14px;
  align-items: flex-start;
}

.funding-popup-panel .funding-row > span {
  flex: 1 1 auto;
  font-size: 11px;
  line-height: 1.25;
}

.funding-popup-panel .funding-row > strong {
  flex: 0 0 auto;
  min-width: 86px;
  text-align: right;
  font-size: 14px;
  line-height: 1.25;
}

.funding-popup-panel .funding-platform-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  margin-top: 3px;
}

.funding-popup-panel .funding-platform-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 3px;
  color: var(--muted);
  white-space: nowrap;
}

.funding-popup-panel .funding-platform-line:not(:last-child)::after {
  content: "/";
  margin-left: 5px;
  color: rgba(142, 160, 173, 0.45);
}

.funding-popup-panel .funding-platform-line em,
.funding-popup-panel .funding-platform-line strong {
  font-size: 11px;
  line-height: 1.2;
}

.funding-popup-panel .funding-platform-line strong {
  font-weight: 800;
}

.funding-popup-panel .funding-hour-row-top {
  padding: 7px 10px;
}

.funding-popup-panel .funding-hour-row-top > strong {
  font-size: 16px;
}

/* Funding popup title inline total */
.funding-popup-title-row {
  display: block;
  margin-right: 40px;
}

.funding-popup-title-row h3 {
  white-space: pre-wrap;
}

#fundingPopupTotal:empty {
  display: none;
}


.funding-title-total {
  white-space: nowrap;
  font-weight: 950;
}


.intraday-chart-panel {
  margin-top: 16px;
}

#intradayChart {
  width: 100%;
  height: 330px;
}


.intraday-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.intraday-tab {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.intraday-tab.active {
  color: var(--ink);
}

.intraday-tab:not(.active):hover {
  color: #cbd7e3;
}

.intraday-chart-panel {
  width: 1200px;
  max-width: 1200px;
  overflow-x: auto;
}

#intradayChart {
  width: 1200px;
  min-width: 1200px;
}

/* Mobile responsive overrides */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
    background: #03050a;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 5, 10, 0.96);
    backdrop-filter: blur(12px);
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 14px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    display: none;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
    background: rgba(16, 26, 36, 0.85);
  }

  .sync-panel {
    margin: 0;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    border-radius: 8px;
    background: rgba(16, 26, 36, 0.72);
  }

  .sync-panel span,
  .sync-panel strong {
    font-size: 11px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sync-panel .primary,
  .sync-panel .full {
    grid-column: 1 / -1;
    min-height: 34px;
  }

  main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    padding: 14px 12px 28px !important;
  }

  .topbar {
    display: none !important;
  }

  #overview.view.active,
  #funding.view.active {
    gap: 18px;
  }

  .metric-grid,
  .funding-metrics {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
    margin: 0 0 12px;
  }

  .metric,
  .metric.large,
  #funding .funding-total-card {
    display: grid !important;
    width: 100% !important;
    min-height: 74px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }

  .metric.large {
    background: var(--summary);
  }

  .metric strong,
  .metric.large strong {
    font-size: 28px;
    line-height: 1.1;
  }

  .metric span,
  .metric small,
  .metric.large span,
  .metric.large small {
    font-size: 12px;
  }

  #overview > .panel,
  .panel,
  .chart-panel,
  .funding-wide-chart,
  .custom-funding-card,
  .funding-wallet-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 14px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--panel) !important;
    overflow: hidden;
  }

  #overview > .panel .panel-head,
  .panel-head,
  .chart-panel .panel-head {
    margin: 0 0 12px !important;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  #overview > .panel .panel-head h2,
  .chart-panel h2,
  .panel-head h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .panel-head p,
  .chart-panel .panel-head p {
    display: block !important;
    font-size: 12px;
    margin-top: 4px;
  }

  .search {
    display: block !important;
    width: 100%;
    min-width: 0;
  }

  .dashboard-grid,
  .funding-dashboard-grid,
  .funding-columns {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin: 0;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .platform-groups {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 12px;
    width: 100%;
  }

  .portfolio-card {
    width: 100% !important;
    flex: none !important;
    gap: 8px;
    justify-items: center;
  }

  .portfolio-card h3 {
    width: 100%;
    font-size: 14px;
  }

  .portfolio-card strong {
    font-size: 13px;
  }

  .portfolio-logo {
    width: min(28vw, 96px);
    height: min(28vw, 96px);
  }

  .platform-group.open .asset-logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    white-space: normal;
  }

  .chart-panel {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .chart-panel canvas,
  #snapshotChart,
  #fundingChart {
    width: 720px !important;
    min-width: 720px !important;
    max-width: none !important;
    height: 300px !important;
  }

  .intraday-chart-panel {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  #intradayChart {
    width: 720px !important;
    min-width: 720px !important;
    max-width: none !important;
    height: 300px !important;
  }

  .intraday-title-row {
    gap: 12px;
    flex-wrap: wrap;
  }

  .intraday-tab {
    font-size: 20px;
  }

  .funding-wallet-head,
  .funding-row,
  .funding-title-total,
  .funding-popup-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .funding-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .funding-platform-list,
  .funding-platform-line {
    min-width: 0;
    max-width: 100%;
  }

  .funding-popup-panel,
  .asset-modal-panel {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 24px) !important;
    margin: 10px;
    overflow-y: auto;
  }

  .asset-modal-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .asset-modal-head img {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 430px) {
  .sidebar {
    padding: 10px;
  }

  main {
    padding: 10px 8px 24px !important;
  }

  .platform-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .portfolio-logo {
    width: min(39vw, 92px);
    height: min(39vw, 92px);
  }

  .panel,
  .chart-panel,
  #overview > .panel {
    padding: 12px !important;
  }

  .panel-head {
    flex-direction: column;
  }

  .metric strong,
  .metric.large strong {
    font-size: 24px;
  }

  .chart-panel canvas,
  #snapshotChart,
  #fundingChart,
  #intradayChart {
    width: 640px !important;
    min-width: 640px !important;
    height: 280px !important;
  }

  .intraday-tab {
    font-size: 18px;
  }
}


.funding-popup-actions .funding-popup-trigger {
  flex: 0 1 auto;
}

/* Funding page order: wallet funding first */
#funding #fundingMetrics {
  order: -100;
}

#funding .funding-wallet-panel {
  order: -90 !important;
}

#funding .position-chart-panel {
  order: -85 !important;
}

#funding .funding-wide-chart {
  order: -80 !important;
}

.position-chart-panel {
  width: 1200px;
  max-width: 1200px;
  overflow-x: auto;
}

#positionChart {
  width: 1200px;
  min-width: 1200px;
  height: 330px;
}

.position-latest {
  color: #22c7ae;
  font-size: 17px;
  white-space: nowrap;
}

#funding .custom-funding-card {
  order: -70 !important;
}


/* Funding recent totals card */
#funding #fundingMetrics {
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
}

#funding .funding-total-card,
#funding .funding-recent-total-card {
  width: 393px;
  flex: 0 0 393px;
  min-height: 82px;
}

#funding .funding-recent-total-card {
  background: #101a24 !important;
  border: 1px solid var(--line);
  color: var(--text);
  display: grid !important;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 10px;
}

#funding .funding-recent-total-card .recent-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
}

#funding .funding-recent-total-card span {
  color: var(--muted);
  font-size: 13px;
}

#funding .funding-recent-total-card strong {
  justify-self: end;
  font-size: 20px;
  line-height: 1.1;
}

@media (max-width: 760px) {
  #funding .funding-total-card,
  #funding .funding-recent-total-card {
    width: 100% !important;
    flex-basis: 100% !important;
  }
}


/* Overview funding summary cards */
#overview > .metric-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
}

#overview > .metric-grid .metric.large {
  width: 393px;
  flex: 0 0 393px;
}

#overview .overview-funding-total-card {
  background: var(--summary) !important;
}

#overview .overview-funding-recent-card,
#funding .funding-recent-total-card {
  background: #101a24 !important;
  border: 1px solid var(--line);
  color: var(--text);
  display: grid !important;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 10px;
}

#overview .overview-funding-recent-card .recent-total-row,
#funding .funding-recent-total-card .recent-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
}

#overview .overview-funding-recent-card span,
#funding .funding-recent-total-card span {
  grid-column: auto !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

#overview .overview-funding-recent-card strong,
#funding .funding-recent-total-card strong {
  justify-self: end;
  font-size: 20px;
  line-height: 1.1;
}

@media (max-width: 760px) {
  #overview > .metric-grid .metric.large {
    width: 100% !important;
    flex-basis: 100% !important;
  }
}


/* Mobile custom order 2564173 / bdefca */
@media (max-width: 760px) {
  .app-shell {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
  }

  .sidebar,
  main,
  #overview.view.active,
  #funding.view.active,
  #overview .dashboard-grid {
    display: contents !important;
  }

  main > .view:not(.active),
  main > .view[hidden] {
    display: none !important;
  }

  .brand {
    order: 0;
    margin: 0 10px;
  }

  nav {
    order: 1;
    margin: 0 10px 2px;
  }

  .sync-panel {
    width: auto !important;
    margin: 0 10px !important;
  }

  body:has(#overview.view.active) .sync-panel {
    order: 50;
  }

  body:has(#funding.view.active) .sync-panel {
    order: 60;
  }

  #overview > .metric-grid,
  #funding > #fundingMetrics {
    display: contents !important;
  }

  #overview > .metric-grid > .metric.large {
    order: 20;
  }

  #overview > .metric-grid > .metric:not(.large) {
    order: 70;
  }

  #overview > .intraday-chart-panel {
    order: 25;
  }

  #overview .dashboard-grid > .chart-panel:not(.intraday-chart-panel) {
    order: 30;
  }

  #overview > section.panel:not(.chart-panel):not(.intraday-chart-panel) {
    order: 40;
  }

  #overview .dashboard-grid > .panel:not(.chart-panel) {
    order: 60;
  }

  #funding > #fundingMetrics > .funding-total-card,
  #funding > #fundingMetrics > .funding-recent-total-card {
    order: 10;
  }

  #funding > .funding-wallet-panel {
    order: 20 !important;
  }

  #funding > .position-chart-panel {
    order: 25 !important;
  }

  #funding > .funding-wide-chart {
    order: 30 !important;
  }

  #funding > .custom-funding-card {
    order: 40 !important;
  }

  #funding > #fundingMetrics > .metric:not(.funding-total-card):not(.funding-recent-total-card) {
    order: 50;
  }

  #overview > .metric-grid > .metric,
  #funding > #fundingMetrics > .metric,
  #overview > .panel,
  #overview .dashboard-grid > .panel,
  #funding > .panel {
    width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
    box-sizing: border-box;
  }

  .position-chart-panel {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  #positionChart {
    width: 720px !important;
    min-width: 720px !important;
    max-width: none !important;
    height: 300px !important;
  }

  .position-chart-panel .panel-head {
    align-items: flex-start;
    gap: 8px;
  }

  .position-latest {
    font-size: 14px;
  }

  #overview .overview-funding-recent-card .recent-total-row,
  #funding .funding-recent-total-card .recent-total-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
  }

  #overview .overview-funding-recent-card span,
  #funding .funding-recent-total-card span {
    grid-column: auto !important;
    white-space: nowrap;
  }

  #overview .overview-funding-recent-card strong,
  #funding .funding-recent-total-card strong {
    justify-self: end !important;
    white-space: nowrap;
  }
}


/* Mobile metric cards match panel width */
@media (max-width: 760px) {
  #overview > .metric-grid > .metric,
  #funding > #fundingMetrics > .metric,
  #overview > .metric-grid > .metric.large,
  #funding > #fundingMetrics > .metric.large,
  #funding .funding-total-card,
  #funding .funding-recent-total-card,
  #overview .overview-funding-total-card,
  #overview .overview-funding-recent-card {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  #overview > .panel,
  #overview .dashboard-grid > .panel,
  #funding > .panel,
  .sync-panel {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 430px) {
  #positionChart {
    width: 640px !important;
    min-width: 640px !important;
    height: 280px !important;
  }
}


/* Overview recent funding clickable rows */
.overview-funding-recent-card .recent-total-clickable {
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.overview-funding-recent-card .recent-total-clickable:hover,
.overview-funding-recent-card .recent-total-clickable:focus-visible {
  outline: none;
  background: rgba(45, 203, 180, 0.09);
}

.funding-title-total {
  margin-left: 18px;
  white-space: nowrap;
}


/* Responsive open-interest chart: always fit the panel without scrollbars. */
#funding .position-chart-panel {
  width: 100% !important;
  max-width: none !important;
  overflow: hidden !important;
}

#funding #positionChart {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 330px;
}

@media (max-width: 760px) {
  #funding #positionChart {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 300px !important;
  }
}

@media (max-width: 430px) {
  #funding #positionChart {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 280px !important;
  }
}


/* 2026-09-01: compact positions dashboard based on the latest reference UI. */
:root {
  --ui-black: #000000;
  --ui-panel: #1b1b1b;
  --ui-panel-soft: #151515;
  --ui-line: #242424;
  --ui-muted: #777777;
  --ui-green: #2df98d;
  --ui-red: #ff3232;
  --ui-yellow: #f8c431;
}

body {
  background: var(--ui-black) !important;
  color: #ffffff !important;
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr) !important;
  background: var(--ui-black) !important;
}

.sidebar {
  width: 220px !important;
  padding: 24px 20px !important;
  background: #020806 !important;
  border-right: 0 !important;
}

.brand-mark {
  border-radius: 8px !important;
  background: #f0bd2d !important;
  color: #020806 !important;
}

.brand strong {
  color: #ffffff !important;
}

.brand span,
.sync-panel span {
  color: #b7c8c2 !important;
}

nav {
  gap: 4px !important;
  margin-top: 82px !important;
}

.nav-item {
  min-height: 34px !important;
  border-radius: 3px !important;
  color: #ffffff !important;
  background: #1d1d1d !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.nav-item.active,
.nav-item:hover {
  background: #252525 !important;
}

.sync-panel {
  background: rgba(0, 30, 21, 0.72) !important;
  border-color: rgba(45, 249, 141, 0.22) !important;
}

.sync-panel .primary {
  background: #382f3e !important;
  color: #ffffff !important;
}

main {
  padding: 0 0 80px 50px !important;
  background: var(--ui-black) !important;
}

.topbar {
  display: none !important;
}

#overview.view.active {
  display: block !important;
}

.overview-board {
  display: grid;
  grid-template-columns: minmax(760px, 1040px) minmax(260px, 340px);
  gap: 96px;
  align-items: start;
  width: min(1440px, calc(100vw - 320px));
  margin-top: 30px;
}

.hero-ledger {
  width: min(1080px, calc(100vw - 290px));
  margin-top: 0;
}

.total-line {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 16px;
}

#totalUsd {
  color: #d8d8d8;
  font-size: 25px;
  line-height: 1;
  font-weight: 700;
}

.delta-value,
.delta-percent {
  font-size: 15px;
  font-weight: 400;
  color: var(--ui-green);
}

.positive {
  color: var(--ui-green) !important;
}

.negative {
  color: var(--ui-red) !important;
}

.trend-board {
  position: relative;
  width: 795px;
  max-width: 100%;
  height: 295px;
  padding: 16px 10px 8px 10px;
  background: var(--ui-panel);
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  width: 150px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 249, 141, 0.82);
  border-radius: 3px;
  background: #07130d;
  color: #ffffff;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.48);
}

.chart-tooltip span,
.chart-tooltip strong {
  display: block;
  line-height: 1.35;
}

.chart-tooltip span {
  color: #cccccc;
  font-size: 12px;
}

.chart-tooltip strong {
  color: var(--ui-green);
  font-size: 13px;
  font-weight: 700;
}

.chart-tabs {
  display: flex;
  gap: 24px;
  padding: 0 0 15px;
  margin: 0;
}

.intraday-tab,
.position-tab {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #bcbcbc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.intraday-tab.active,
.position-tab.active {
  color: #ffffff;
}

#intradayChart {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  height: 250px !important;
}

.positions-board {
  width: min(1095px, 100%);
  margin-top: 38px;
  background: transparent;
}

.asset-distribution {
  min-width: 0;
  padding-top: 8px;
  color: #ffffff;
  transform: translateX(80px);
}

.asset-distribution h2 {
  margin: 0 0 26px;
  color: #f7f7f7;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.asset-distribution-list {
  display: grid;
  gap: 22px;
}

.distribution-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  min-height: 32px;
  color: #ffffff;
}

.distribution-logo {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

.distribution-item span {
  min-width: 0;
  overflow: hidden;
  color: #f0f0f0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-item strong {
  color: #f5f5f5;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-align: right;
}

.distribution-empty,
.small-assets-toggle {
  color: #666666;
  font-size: 14px;
}

.small-assets-toggle {
  margin-top: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.small-assets-toggle:hover {
  color: var(--ui-green);
}

.positions-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 18px;
  padding-left: 8px;
}

.positions-table-wrap {
  width: calc(100% + 30px);
  overflow-x: visible;
}

.positions-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  color: #ffffff;
  font-size: 11px;
}

.positions-table thead tr {
  border-top: 1px solid var(--ui-line);
}

.positions-table th,
.positions-table td {
  padding: 10px 11px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #111111;
  overflow: hidden;
  text-overflow: ellipsis;
}

.positions-table th {
  color: #d5d5d5;
  font-size: 11px;
  font-weight: 800;
}

.positions-table th:nth-child(1),
.positions-table td:nth-child(1) {
  width: 7%;
}

.positions-table th:nth-child(2),
.positions-table td:nth-child(2) {
  width: 8%;
}

.positions-table th:nth-child(3),
.positions-table td:nth-child(3) {
  width: 8%;
}

.positions-table th:nth-child(4),
.positions-table td:nth-child(4),
.positions-table th:nth-child(5),
.positions-table td:nth-child(5),
.positions-table th:nth-child(6),
.positions-table td:nth-child(6) {
  width: 8%;
}

.positions-table th:nth-child(7),
.positions-table td:nth-child(7) {
  width: 10%;
}

.positions-table th:nth-child(8),
.positions-table td:nth-child(8) {
  width: 8%;
}

.positions-table th:nth-child(9) {
  width: 12%;
  padding-left: 41px;
  overflow: visible;
  text-overflow: clip;
}

.positions-table td:nth-child(9) {
  width: 12%;
  padding-left: 17px;
  overflow: visible;
  text-overflow: clip;
}

.positions-table th:nth-child(10),
.positions-table td:nth-child(10) {
  width: 9%;
}

.positions-table th:nth-child(11),
.positions-table td:nth-child(11) {
  width: 8%;
}

.positions-table th:nth-child(12),
.positions-table td:nth-child(12) {
  width: 5%;
  text-align: center;
}

.sort-head {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sort-head.active {
  color: #ffffff;
}

.sort-head:hover {
  color: var(--ui-green);
}

.sort-arrow {
  display: inline-block;
  width: 10px;
  color: var(--ui-green);
  font-size: 10px;
  line-height: 1;
  vertical-align: 1px;
}

.positions-table td {
  color: #d2d2d2;
  font-weight: 700;
}

.positions-table .market-cell {
  font-weight: 900;
}

.positions-table .market-cell.long {
  color: var(--ui-green);
}

.positions-table .market-cell.short {
  color: var(--ui-red);
}

.funding-fee-cell {
  color: inherit;
}

.funding-fee-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
}

.funding-fee-inner span {
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
}

.funding-market-btn {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7b7b7b;
  cursor: pointer;
}

.funding-market-btn img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.funding-market-btn:not(.active) img {
  filter: grayscale(1) brightness(0.58);
  opacity: 0.82;
}

.funding-market-btn.active img {
  filter: sepia(1) saturate(6) hue-rotate(84deg) brightness(1.25);
  opacity: 1;
}

.funding-net {
  color: var(--ui-green) !important;
}

.positions-summary-row td {
  padding-top: 16px;
  padding-left: 8px;
  border-bottom: 0;
  overflow: visible;
}

.positions-summary {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #a5a5a5;
  font-size: 13px;
  font-weight: 700;
}

.funding-market-summary-list {
  display: grid;
  gap: 12px;
  width: min(840px, 100%);
  margin: 2px 0 0 0;
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 400;
}

.funding-market-summary-row {
  display: grid;
  grid-template-columns: 58px 112px 132px 160px 160px;
  align-items: center;
  column-gap: 12px;
  text-align: left;
}

.funding-market-summary-row strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.funding-market-summary-row span {
  color: #d8d8d8;
  font-weight: 400;
}

.funding-market-summary-row em {
  color: #ffffff;
  font-style: normal;
  font-weight: 400;
}

.funding-market-summary-row em.positive {
  color: var(--ui-green) !important;
}

.funding-market-summary-row em.negative {
  color: var(--ui-red) !important;
}

.funding-market-summary-total {
  margin-top: 2px;
  text-align: left;
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 400;
}

.funding-market-summary-total strong {
  margin-left: 4px;
  font-weight: 800;
}

.positions-summary strong {
  margin-left: 6px;
  color: #ffffff;
  font-weight: 800;
}

.positions-empty {
  color: var(--ui-muted) !important;
  height: 120px;
  text-align: center !important;
}

.favorite-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #666666;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.favorite-btn.active {
  color: var(--ui-yellow);
}

@media (max-width: 920px) {
  .app-shell {
    display: block !important;
  }

  .sidebar {
    position: static !important;
    width: 100% !important;
    height: auto !important;
  }

  nav {
    margin-top: 10px !important;
  }

  main {
    padding: 24px 16px 60px !important;
  }

  .hero-ledger {
    width: 100%;
    margin-top: 32px;
  }

  .trend-board {
    width: 100%;
  }

  .overview-board {
    display: block;
    width: 100%;
    margin-top: 24px;
  }

  .asset-distribution {
    margin-top: 40px;
    transform: none;
  }
}
