/* Local UI overrides. Keep changes here so the downloaded build stays easy to compare. */

/* 仓位汇总表格：表头与数据按同一列轨道左对齐。 */
.ratio-position-table {
  table-layout: fixed !important;
  width: max-content !important;
  min-width: 100% !important;
}

html body #root .ratio-position-table thead,
html body #root .ratio-position-table tbody {
  display: block !important;
}

html body #root .ratio-position-table thead tr,
html body #root .ratio-position-table tbody tr {
  display: grid !important;
  grid-template-columns: 92px repeat(4, 68px) repeat(6, 112px) repeat(4, 132px);
  width: max-content !important;
}

html body #root .ratio-position-table thead th,
html body #root .ratio-position-table tbody td {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 12px 12px !important;
  text-align: left !important;
}

html body #root .ratio-position-table thead th:first-child,
html body #root .ratio-position-table tbody td:first-child {
  padding-left: 14px !important;
}

html body #root .ratio-position-table thead th:not(:first-child),
html body #root .ratio-position-table tbody td:not(:first-child) {
  padding-left: 4px !important;
}

html body #root .ratio-position-table thead th > button,
html body #root .ratio-position-table thead th > div,
html body #root .ratio-position-table tbody td > div,
html body #root .ratio-position-table tbody td > button {
  justify-content: flex-start !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  min-width: 0 !important;
  text-align: left !important;
  width: auto !important;
}

html body #root .ratio-position-table thead th > button > span {
  order: 1;
}

html body #root .ratio-position-table thead th > button > svg {
  flex: 0 0 auto;
  margin-left: 2px;
  order: 2;
}

/* 仓位汇总表格外框铺满页面卡片宽度。 */
html body #root .space-y-5 > .page-table-card:has(.ratio-position-table) {
  margin-left: -20px !important;
  margin-right: -20px !important;
  width: calc(100% + 40px) !important;
}

html body #root .space-y-5 > .page-table-card:has(.ratio-position-table) > .overflow-x-auto {
  width: 100% !important;
}
