
.trading-manual-test-section {
  margin-top: 18px;
}

/* Risk control */

#riskMode {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

#riskMode[hidden] {
  display: none;
}

.risk-control-panel,
.risk-overview-panel,
.risk-holdings-panel,
.risk-reduction-panel {
  border-color: rgba(15, 143, 141, 0.2);
  min-width: 0;
}

.risk-control-eyebrow {
  color: #0f8f8d;
  margin: 0 0 5px;
}

.risk-control-panel > .section-head > div p,
.risk-reduction-panel > .section-head > div p {
  max-width: 760px;
  text-align: left;
}

.risk-status-badge,
.risk-row-state {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  padding: 8px 12px;
  white-space: nowrap;
}

.risk-status-badge.running,
.risk-row-state.normal,
.risk-row-state.matched {
  background: #e5f8f3;
  color: #087f6b;
}

.risk-status-badge.stopped,
.risk-row-state.warning,
.risk-row-state.unhedged {
  background: #fff4df;
  color: #9b6213;
}

.risk-status-badge.idle {
  background: #eef3f7;
  color: #607086;
}

.risk-row-state.critical {
  background: #feeceb;
  color: #c9342b;
}

.risk-control-form,
.risk-reduction-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 16px;
}

.risk-reduction-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.risk-control-form label,
.risk-reduction-form label {
  color: #627089;
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 7px;
}

.risk-control-actions {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 16px;
}

.risk-control-actions .hint {
  margin: 0;
}

.risk-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.risk-summary-grid article {
  background: #f7fafc;
  border: 1px solid #dbe5ec;
  border-radius: 12px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 16px;
}

.risk-summary-grid span,
.risk-summary-grid small {
  color: #75839a;
}

.risk-summary-grid strong {
  color: #172235;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.risk-alert-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.risk-alert {
  border: 1px solid #efd8a8;
  border-left: 4px solid #d99625;
  border-radius: 10px;
  padding: 12px 14px;
}

.risk-alert.critical {
  background: #fff7f6;
  border-color: #f2c0bc;
  border-left-color: #cf3e35;
}

.risk-alert p {
  color: #66748b;
  margin: 4px 0 0;
}

.risk-empty-state {
  background: #f7fafc;
  border: 1px dashed #cad7e1;
  border-radius: 10px;
  color: #75839a;
  padding: 14px;
}

.risk-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.risk-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.risk-futures-table {
  min-width: 1120px;
}

.risk-position-filter-groups {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(150px, 180px)) minmax(190px, 220px);
  justify-content: flex-end;
  width: min(100%, 604px);
}

.risk-position-filter-field {
  color: #627089;
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 7px;
  min-width: 0;
  text-align: left;
}

.risk-position-filter-field > select,
.risk-position-filter-field .styled-select {
  width: 100%;
}

.risk-position-filter-field .styled-select-trigger {
  margin: 0;
}

.risk-table th,
.risk-table td {
  border-bottom: 1px solid #e1e8ee;
  padding: 13px 11px;
  text-align: left;
  vertical-align: middle;
}

.risk-table th {
  color: #728097;
  font-size: 12px;
  white-space: nowrap;
}

.risk-table td {
  color: #263348;
  font-size: 13px;
}

.risk-table td small {
  color: #7a889e;
  display: block;
  margin-top: 4px;
}

.risk-table .positive {
  color: #07886e;
}

.risk-table .negative {
  color: #cf3e35;
}

.risk-reduction-open {
  padding: 8px 11px;
  white-space: nowrap;
}

.risk-reduction-preview {
  background: #f2f7f9;
  border: 1px solid #d4e1e7;
  border-radius: 10px;
  color: #536176;
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 14px;
}

.risk-reduction-preview strong {
  color: #263348;
}

@media (max-width: 1180px) {
  .risk-control-form {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .risk-summary-grid,
  .risk-reduction-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .risk-control-form,
  .risk-summary-grid,
  .risk-reduction-form {
    grid-template-columns: 1fr;
  }

  .risk-control-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .risk-position-filter-groups {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .trading-analysis-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trading-analysis-filters > button {
    width: 100%;
  }

  .trading-analysis-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trading-analysis-kpis .stat:nth-child(4n) {
    border-right: 1px solid #e3eaee;
  }

  .trading-analysis-kpis .stat:nth-child(2n) {
    border-right: 0;
  }

  .trading-analysis-kpis .stat:nth-last-child(-n + 4) {
    border-bottom: 1px solid #e3eaee;
  }

  .trading-analysis-kpis .stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .trading-analysis-datetime.is-end .trading-analysis-datetime-popover {
    right: auto;
    left: 0;
  }
}

@media (max-width: 760px) {
  .trading-analysis-summary,
  .trading-analysis-open-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .trading-analysis-toggle {
    width: 100%;
  }

  .trading-analysis-filters,
  .trading-analysis-kpis,
  .trading-analysis-extremes {
    grid-template-columns: 1fr;
  }

  .trading-analysis-extremes article {
    grid-template-columns: 1fr;
  }

  .trading-analysis-kpis .stat,
  .trading-analysis-kpis .stat:nth-child(2n),
  .trading-analysis-kpis .stat:nth-child(4n) {
    border-right: 0;
    border-bottom: 1px solid #e3eaee;
  }

  .trading-analysis-kpis .stat:nth-last-child(-n + 2) {
    border-bottom: 1px solid #e3eaee;
  }

  .trading-analysis-kpis .stat:last-child {
    border-bottom: 0;
  }

  .trading-analysis-extremes small {
    text-align: left;
  }

  .trading-analysis-datetime-popover {
    width: min(332px, calc(100vw - 48px));
  }
}

.trading-manual-test-section .trading-card {
  margin: 0;
}

.trading-strategy-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid #d8e3e9;
  border-radius: 10px;
  padding: 6px;
  background: #eef4f6;
  box-shadow: 0 8px 24px rgba(35, 55, 70, 0.05);
}

.trading-strategy-tabs .trading-strategy-tab.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 16px;
  color: #52677b;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
}

.trading-strategy-tabs .trading-strategy-tab.btn:not(.active):hover:not(:disabled) {
  border-color: #b8d7d4;
  color: #087f72;
  background: #fff;
}

.trading-strategy-tabs .trading-strategy-tab.btn.active {
  border-color: #138f89;
  color: #fff;
  background: #168f87;
  box-shadow: 0 5px 12px rgba(22, 143, 135, 0.2);
}

[data-trading-strategy-panel][hidden] {
  display: none !important;
}

.trading-strategy-placeholder {
  display: grid;
  gap: 9px;
  margin: 0;
  min-height: 190px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.trading-strategy-placeholder h3,
.trading-strategy-placeholder p {
  margin: 0;
}

.trading-strategy-placeholder p {
  max-width: 680px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.7;
}

.trading-manual-test-disclosure,
.trading-v2-disclosure {
  overflow: hidden;
  border-radius: 8px;
}

.trading-manual-test-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.trading-manual-test-summary::-webkit-details-marker {
  display: none;
}

.trading-manual-test-summary::marker {
  content: "";
}

.trading-manual-test-summary h3,
.trading-manual-test-summary p {
  margin: 0;
}

.trading-manual-test-summary p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.trading-manual-test-summary-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
}

.trading-manual-test-toggle {
  min-width: 106px;
  border: 1px solid #b9c9d6;
  border-radius: 7px;
  padding: 8px 12px;
  color: #40576b;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.trading-manual-test-toggle .when-open {
  display: none;
}

.trading-manual-test-disclosure[open] .trading-manual-test-toggle .when-closed {
  display: none;
}

.trading-manual-test-disclosure[open] .trading-manual-test-toggle .when-open {
  display: inline;
}

.trading-v2-disclosure[open] .trading-manual-test-toggle .when-closed {
  display: none;
}

.trading-v2-disclosure[open] .trading-manual-test-toggle .when-open {
  display: inline;
}

.trading-manual-test-body {
  margin-top: 16px !important;
}

.binance-live-order-card .trading-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.binance-live-order-card h3,
.binance-live-order-card p {
  margin: 0;
}

.binance-live-order-card .trading-card-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.live-order-risk-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 1px solid #e9aaa2;
  border-radius: 999px;
  padding: 5px 9px;
  color: #a62b21;
  background: #fff1ef;
  font-size: 11px;
  font-weight: 850;
}

.binance-live-order-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(160px, auto);
  gap: 12px;
  align-items: end;
}

.live-order-reduce-only {
  min-height: 44px;
  align-content: center;
}

.binance-live-order-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  margin-top: 12px;
  border: 1px solid #e2e8ee;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
}

.binance-live-order-preview strong {
  color: var(--ink);
}

.binance-live-order-preview span,
.binance-live-order-preview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.binance-live-order-preview small {
  grid-column: 1 / -1;
}

.binance-live-order-preview.ready {
  border-color: #a8dcc9;
  background: #f3fbf7;
}

.binance-live-order-preview.warning {
  border-color: #efc08a;
  background: #fff8ee;
}

.danger-action {
  border-color: #a62b21;
  color: #fff;
  background: #b83228;
}

.danger-action:hover:not(:disabled) {
  background: #8f251e;
}

.binance-live-order-history {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.binance-live-order-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #dfe6ec;
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
}

.binance-live-order-row div {
  display: grid;
  gap: 3px;
}

.binance-live-order-row small,
.binance-live-order-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.binance-live-order-row b {
  color: #087f5b;
  font-size: 12px;
}

.binance-live-order-row.live b {
  color: #b42318;
}

.trading-v2-section {
  margin-top: 18px;
  border-color: #b9ded9;
  background: linear-gradient(180deg, #fbfefd 0%, #f7fbfb 100%);
}

.trading-v2-card {
  margin: 16px 0 0 !important;
  border-color: #b9ded9;
  background: #fff;
}

.trading-v2-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid #dce9e8;
  padding-bottom: 12px;
}

.trading-v2-block-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trading-v2-block-heading span {
  border: 1px solid #9bd4cc;
  border-radius: 999px;
  padding: 4px 8px;
  color: #087f72;
  background: #effaf8;
  font-size: 10px;
  font-weight: 850;
}

.trading-v2-block-heading strong {
  color: #243447;
  font-size: 14px;
}

.trading-v2-block-heading small {
  color: #718096;
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.trading-v2-safety-badge {
  border: 1px solid #80c9be;
  border-radius: 999px;
  padding: 5px 9px;
  color: #087f72;
  background: #eefaf7;
  font-size: 11px;
  font-weight: 850;
}

.trading-v2-notice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
  padding: 11px 13px;
}

.trading-v2-notice > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #168f87;
  font-weight: 900;
}

.trading-v2-notice p {
  margin: 0;
  color: #3f6265;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
}

.trading-v2-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 12px;
  align-items: end;
}

.trading-v2-form > [hidden] {
  display: none !important;
}

.trading-v2-reduce-only {
  min-height: 44px;
  align-content: center;
}

.trading-v2-position-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #d8e4ea;
  border-radius: 9px;
  padding: 13px;
  background: #f8fafb;
}

.trading-v2-position-section {
  margin: 16px 0 0;
  border-color: #b9ded9;
  background: linear-gradient(180deg, #fbfefd 0%, #f7fbfb 100%);
}

.trading-v2-position-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trading-v2-position-panel > header > div {
  display: grid;
  gap: 2px;
}

.trading-v2-position-panel > header strong {
  color: #243447;
  font-size: 14px;
}

.trading-v2-position-panel > header span {
  color: #78879a;
  font-size: 11px;
  font-weight: 650;
}

.trading-v2-position-panel > header button {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.trading-v2-position-actions,
.trading-v2-position-scope {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trading-v2-position-scope {
  gap: 0;
  overflow: hidden;
  border: 1px solid #bfd0dc;
  border-radius: 7px;
  background: #fff;
}

.trading-v2-position-panel > header .trading-v2-position-scope button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  padding: 6px 10px;
  color: #607086;
  background: transparent;
  box-shadow: none;
}

.trading-v2-position-panel > header .trading-v2-position-scope button + button {
  border-left: 1px solid #d8e4ea;
}

.trading-v2-position-panel > header .trading-v2-position-scope button.active {
  color: #fff;
  background: #15928f;
}

.trading-v2-position-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trading-v2-position-grid.show-all {
  grid-template-columns: minmax(0, 1fr);
}

.trading-v2-position-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  border: 1px solid #dce5eb;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
}

.trading-v2-position-card.empty,
.trading-v2-position-card.error {
  min-height: 82px;
  align-content: center;
  color: #718096;
  font-weight: 650;
}

.trading-v2-position-card.error {
  border-color: #f0cbc6;
  color: #b42318;
  background: #fff8f7;
}

.trading-v2-position-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trading-v2-position-card > header strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1f2d3d;
  font-size: 13px;
}

.trading-v2-position-card > header span {
  color: #75869a;
  font-size: 11px;
  font-weight: 700;
}

.trading-v2-position-primary {
  color: #118b75;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.trading-v2-position-primary.short {
  color: #c4322b;
}

.trading-v2-position-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.trading-v2-position-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #7a899a;
  font-size: 10px;
  font-weight: 650;
}

.trading-v2-position-metrics b {
  overflow-wrap: anywhere;
  color: #344256;
  font-size: 12px;
}

.trading-v2-position-summary {
  color: #718096;
  font-size: 10px;
  font-weight: 650;
}

.trading-v2-position-account-summary {
  border-radius: 6px;
  padding: 7px 9px;
  color: #4f6578;
  background: #f2f6f8;
  font-size: 10px;
  font-weight: 700;
}

.trading-v2-position-details {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-top: 1px solid #e3eaf0;
  padding-top: 9px;
}

.trading-v2-position-details > strong {
  color: #4a5b6e;
  font-size: 11px;
}

.trading-v2-position-details > small {
  color: #8592a1;
  font-size: 10px;
}

.trading-v2-position-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  background: #fbfcfd;
}

.trading-v2-position-table-wrap table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 10px;
}

.trading-v2-position-table-wrap th,
.trading-v2-position-table-wrap td {
  padding: 6px 8px;
  text-align: right;
  white-space: nowrap;
}

.trading-v2-position-table-wrap th:first-child,
.trading-v2-position-table-wrap td:first-child,
.trading-v2-position-table-wrap th:nth-child(2),
.trading-v2-position-table-wrap td:nth-child(2) {
  text-align: left;
}

.trading-v2-position-table-wrap th {
  color: #718096;
  background: #f2f6f8;
  font-weight: 750;
}

.trading-v2-position-table-wrap td {
  border-top: 1px solid #e7edf1;
  color: #344256;
  font-weight: 650;
}

.trading-v2-guard-settings {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #cfe1e3;
  border-radius: 8px;
  padding: 13px;
  background: #f7fbfb;
}

.trading-v2-guard-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.trading-v2-guard-heading strong {
  color: #244d51;
  font-size: 13px;
}

.trading-v2-guard-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trading-v2-plan {
  grid-template-columns: minmax(220px, auto) 1fr;
}

.trading-v2-plan .trading-v2-guard-reasons {
  color: #b42318;
}

.trading-v2-monitor-window {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #c9dfdf;
  border-radius: 10px;
  padding: 14px;
  background: #f7fbfb;
}

.trading-v2-monitor-window > header,
.trading-v2-monitor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.trading-v2-monitor-window h4,
.trading-v2-history-title {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.trading-v2-monitor-window header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trading-v2-monitors {
  display: grid;
  gap: 12px;
}

.trading-v2-monitor-card {
  display: grid;
  gap: 12px;
  border: 1px solid #bcd8d5;
  border-left: 4px solid #168f87;
  border-radius: 9px;
  padding: 13px;
  background: #fff;
}

.trading-v2-monitor-card.completed {
  border-left-color: #218b57;
}

.trading-v2-monitor-card.error,
.trading-v2-monitor-card.stopped {
  border-left-color: #c43b31;
}

.trading-v2-monitor-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.trading-v2-monitor-head small {
  display: block;
  margin-top: 3px;
}

.trading-v2-monitor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.trading-v2-monitor-parameter-editor {
  display: grid;
  grid-template-columns: auto minmax(96px, 140px) auto minmax(120px, 1fr) auto minmax(96px, 140px) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #dce8e7;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbfb;
}

.trading-v2-monitor-parameter-editor label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.trading-v2-monitor-parameter-editor input {
  width: 100%;
  min-height: 36px;
  height: 36px;
}

.trading-v2-monitor-parameter-editor small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.trading-v2-monitor-status {
  border-radius: 999px;
  padding: 5px 9px;
  color: #087f72;
  background: #e4f7f2;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

#usStockSpreadStatus:not(.ready) {
  color: #76542a;
  background: #fff6df;
}

.us-stock-spread-feed .trading-v2-monitor-log {
  max-height: 280px;
}

.trading-v2-monitor-card.error .trading-v2-monitor-status,
.trading-v2-monitor-card.stopped .trading-v2-monitor-status {
  color: #a72d25;
  background: #fff0ee;
}

.trading-v2-monitor-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.trading-v2-monitor-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #dce8e7;
  border-radius: 7px;
  padding: 9px 10px;
  background: #f8fbfb;
}

.trading-v2-monitor-stat span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-v2-monitor-stat b {
  color: var(--ink);
  font-size: 13px;
}

.trading-v2-monitor-stat b.ready {
  color: #168452;
}

.trading-v2-monitor-stat b.blocked {
  color: #c43b31;
}

.trading-v2-monitor-reason {
  margin: 0;
  color: #76542a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.trading-v2-monitor-log {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #273846;
  border-radius: 8px;
  padding: 10px 12px;
  color: #b9c8d5;
  background: #101b25;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.trading-v2-monitor-log span {
  white-space: pre-wrap;
}

.trading-v2-monitor-log .ready,
.trading-v2-monitor-log .success {
  color: #52ddb0;
}

.trading-v2-monitor-log .warning,
.trading-v2-monitor-log .error {
  color: #ff9a8f;
}

.trading-v2-history-title {
  margin-top: 18px;
}

.trading-v2-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.trading-v2-history-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(250px, auto) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dce7e6;
  border-left: 4px solid #8aa4a2;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
}

.trading-v2-history-row.success {
  border-left-color: #1f9d72;
}

.trading-v2-history-row.danger {
  border-left-color: #d33b32;
}

.trading-v2-history-row.pending {
  border-left-color: #d8942f;
}

.trading-v2-history-row > div:not(.trading-v2-history-actions) {
  display: grid;
  gap: 3px;
}

.trading-v2-history-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.trading-v2-history-row small,
.trading-v2-history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trading-v2-history-row span small {
  display: block;
  margin-top: 3px;
}

.trading-v2-history-row b {
  color: #176c60;
  font-size: 12px;
  white-space: nowrap;
}

.trading-v2-history-row.danger b {
  color: #b42318;
}

.trading-v2-history-row button {
  min-height: 34px;
  padding: 6px 10px;
}

.trading-strategy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trading-strategy-grid.risk-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.trading-toggles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trading-form label,
.trading-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.grid-count-preview {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cfe0df;
  border-radius: 7px;
  color: #087f7b;
  background: #f2fbfa;
  font-size: 15px;
  font-weight: 800;
}

.grid-count-preview.invalid {
  border-color: #f0b8ae;
  color: #b42318;
  background: #fff5f2;
}

.grid-count-help {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.trading-result,
.trading-orders,
.trade-leg-list {
  display: grid;
  gap: 10px;
}

.trading-live-section {
  margin-bottom: 18px;
  padding-top: 14px;
}

.trading-live-section .section-head {
  margin-bottom: 10px;
}

.trading-live-section .section-head h2 {
  font-size: 19px;
}

.trading-live-section .section-head p {
  font-size: 13px;
  line-height: 1.35;
}

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

.trading-live-card {
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  padding: 9px 11px;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.trading-live-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trading-live-card h3 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.05;
}

.trading-live-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
  font-size: 12px;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef1f5;
  padding-top: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.price-line strong {
  color: var(--ink);
  font-size: 16px;
}

.spread-card.ready {
  background: #f8fbfd;
}

.spread-card.triggered {
  border-color: rgba(194, 65, 12, 0.3);
  background: #fff4ed;
}

.spread-card.triggered h3,
.spread-card.triggered .price-line strong {
  color: #9a3412;
}

.spread-card.waiting {
  background: #fbfcfe;
}

.trading-live-log {
  border: 1px solid #e8edf3;
  border-radius: 7px;
  background: #0f1720;
  color: #c8d2df;
  padding: 10px 12px;
  margin-top: 10px;
  display: grid;
  gap: 2px;
  min-height: 420px;
  max-height: 560px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.28;
}

.trading-live-log p {
  margin: 0;
  white-space: nowrap;
}

.strategy-base-card[hidden] {
  display: none !important;
}

.trading-grid-feed {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.trading-grid-feed h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.trading-grid-feed .trading-live-log {
  min-height: 220px;
  max-height: min(48vh, 460px);
  margin-top: 0;
  scrollbar-gutter: stable;
}

.trading-grid-feed .trading-live-log p {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.trading-recent-trades {
  display: grid;
  gap: 9px;
  max-height: min(55vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 5px;
}

.trading-action-row {
  justify-content: flex-end;
  margin-top: 12px;
}

.trade-leg-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.trade-leg,
.trading-order {
  border: 1px solid #eef1f5;
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
}

.trade-leg span,
.trading-order small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.trade-leg strong {
  display: block;
  margin: 4px 0;
  font-size: 17px;
}

.trading-order p {
  margin: 8px 0 0;
}

.adr-grid-config-card > .hint {
  margin: 0 0 12px;
}

.adr-grid-config-card .trading-card-head h3,
.adr-grid-config-card .trading-card-head p {
  margin: 0;
}

.adr-grid-config-card .trading-card-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trading-grid-create-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  border-top: 1px solid #e7ecf1;
  padding-top: 14px;
}

.trading-grid-create-row .hint {
  margin: 0;
}

.trading-grid-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.trading-grid-performance-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trading-grid-overview-head {
  align-items: flex-start;
  margin-bottom: 18px;
  border-bottom: 1px solid #e5ebf0;
  padding-bottom: 16px;
}

.trading-grid-overview-title {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.trading-grid-overview-title h2,
.trading-grid-overview-title p {
  margin: 0;
}

.trading-grid-overview-title .badge {
  margin-bottom: 2px;
}

.trading-grid-primary-summary {
  margin-bottom: 12px;
}

.trading-grid-stat,
.trading-grid-lot {
  border: 1px solid #dce4eb;
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
}

.trading-grid-stat {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}

.trading-grid-primary-summary .trading-grid-stat {
  min-height: 98px;
  border-color: #d8e4e8;
  background: linear-gradient(145deg, #fff 0%, #f8fbfb 100%);
}

.trading-grid-primary-summary .trading-grid-stat::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #15958e;
  content: "";
}

.trading-grid-primary-summary .trading-grid-stat:nth-child(2)::before {
  background: #5f7891;
}

.trading-grid-primary-summary .trading-grid-stat:nth-child(3)::before {
  background: #8293a6;
}

.trading-grid-primary-summary .trading-grid-stat:nth-child(4)::before {
  background: #16895d;
}

.trading-grid-stat span,
.trading-grid-lot small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.trading-grid-stat strong {
  min-width: 0;
  color: #1d2939;
  font-size: clamp(18px, 1.35vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.trading-grid-stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.trading-grid-performance-summary .trading-grid-stat {
  min-height: 108px;
  border-color: #e0e7ed;
  background: #f8fafc;
  box-shadow: none;
}

.trading-grid-performance-summary .trading-grid-stat span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trading-grid-performance-summary .trading-grid-stat span::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8da2b5;
  content: "";
}

.trading-grid-performance-summary .trading-grid-stat strong {
  font-size: clamp(17px, 1.2vw, 20px);
}

.trading-grid-position-overview {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid #d8e5e7;
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(145deg, #fbfefe 0%, #f5faf9 100%);
}

.trading-grid-position-overview-head,
.trading-grid-position-overview-head > div,
.trading-grid-position-row,
.trading-grid-position-identity {
  display: flex;
  align-items: center;
}

.trading-grid-position-overview-head {
  justify-content: space-between;
  gap: 16px;
}

.trading-grid-position-overview-head > div {
  gap: 11px;
  min-width: 0;
}

.trading-grid-position-overview-head h3,
.trading-grid-position-overview-head p {
  margin: 0;
}

.trading-grid-position-overview-head h3 {
  color: #1d2939;
  font-size: 16px;
}

.trading-grid-position-overview-head p,
.trading-grid-position-overview-head > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trading-grid-position-overview-head > span {
  flex: 0 0 auto;
  text-align: right;
}

.trading-grid-position-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.trading-grid-position-metrics article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #dce7e8;
  border-radius: 9px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.9);
}

.trading-grid-position-metrics span,
.trading-grid-position-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.trading-grid-position-metrics strong {
  color: #1d2939;
  font-size: clamp(16px, 1.15vw, 19px);
  overflow-wrap: anywhere;
}

.trading-grid-position-metrics small {
  color: #8794a2;
  font-size: 10px;
  font-weight: 650;
}

.trading-grid-position-list {
  display: grid;
  gap: 7px;
}

.trading-grid-position-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(4, minmax(125px, 1fr));
  gap: 12px;
  border-top: 1px solid #dce7e8;
  padding: 10px 4px 0;
}

.trading-grid-position-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.trading-grid-position-row strong {
  color: #263443;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.trading-grid-position-row em {
  font-style: normal;
}

.trading-grid-position-identity {
  align-items: flex-start;
  flex-direction: column;
}

.trading-grid-position-empty {
  border-top: 1px solid #dce7e8;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .trading-grid-primary-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trading-grid-position-metrics,
  .trading-grid-position-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.trading-grid-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  max-height: 190px;
  overflow: auto;
  align-content: flex-start;
  padding-right: 4px;
}

.trading-grid-level {
  border: 1px solid #dce4eb;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.trading-grid-level.occupied {
  border-color: rgba(13, 148, 136, 0.35);
  background: #ecfdf5;
  color: #0f766e;
}

.trading-grid-level.reached:not(.occupied) {
  border-color: #f0c98d;
  background: #fff8e8;
  color: #8a4b08;
}

.trading-grid-lots {
  display: grid;
  gap: 9px;
}

.trading-execution-group {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--color-base-300, #dce4eb);
  border-radius: 10px;
  padding: 10px;
  background: #f6f8fa;
}

.trading-execution-batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 7px;
}

.trading-execution-batch-title,
.trading-execution-batch-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.trading-execution-batch-title > strong {
  max-width: 320px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-execution-batch-metrics {
  justify-content: flex-end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trading-execution-batch-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.trading-execution-batch-records {
  display: grid;
  gap: 9px;
}

.trading-execution-batch-records .trading-grid-lot {
  margin: 0;
}

.trading-grid-lot-head,
.trading-grid-lot-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trading-grid-lot-head strong {
  font-size: 14px;
}

.trading-grid-lot-title {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.trading-grid-lot-identifiers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.trading-grid-lot-identifiers span,
.trading-grid-lot-identifiers code {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.trading-grid-group-tag {
  background: #e7f8f4;
  color: #087f6c;
}

.trading-grid-slice-tag {
  background: #edf3f8;
  color: #52657a;
}

.trading-grid-lot-identifiers code {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f5f7fa;
  color: #758397;
}

.trading-grid-lot-metrics {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trading-grid-lot .positive {
  color: #047857;
}

.trading-grid-lot .negative {
  color: #b91c1c;
}

.trading-grid-funding-note {
  margin: 10px 0 0;
}

.trading-grid-instances {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.trading-grid-instance {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfd9e3;
  border-radius: 12px;
  background: #17212d;
  color: #edf4f7;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.trading-grid-instance-head,
.grid-order-counts,
.grid-instance-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trading-grid-instance-head h3,
.trading-grid-instance-head p {
  margin: 0;
}

.trading-grid-instance-head h3 {
  margin-top: 5px;
  color: #f7fbfc;
  font-size: 19px;
}

.trading-grid-instance-head p {
  margin-top: 5px;
  color: #9fb0bf;
  font-size: 12px;
}

.grid-instance-sequence {
  color: #b6c4cf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.grid-instance-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: #a8b6c2;
  background: #263442;
  font-size: 12px;
  font-weight: 800;
}

.grid-instance-status.active {
  color: #3dd6a4;
  background: rgba(16, 185, 129, 0.14);
}

.grid-instance-head-actions {
  display: flex;
  position: relative;
  align-items: center;
  gap: 8px;
}

.grid-edit-qty-button {
  min-height: 32px;
  padding: 5px 9px;
  border-color: #3b6d70;
  color: #8de1d1;
  background: rgba(13, 148, 136, 0.09);
  font-size: 11px;
}

.grid-manual-reduce-button {
  min-height: 32px;
  padding: 5px 9px;
  border-color: rgba(248, 113, 113, 0.48);
  color: #ffb2a8;
  background: rgba(220, 38, 38, 0.1);
  font-size: 11px;
}

.grid-manual-reduce-button:disabled {
  opacity: 0.45;
}

.grid-quantity-editor {
  position: absolute;
  z-index: 12;
  top: calc(100% + 9px);
  right: 0;
  width: min(340px, calc(100vw - 48px));
  border: 1px solid #405466;
  border-radius: 9px;
  padding: 13px;
  color: #dce6ec;
  background: #111c27;
  box-shadow: 0 18px 44px rgba(2, 8, 16, 0.42);
}

.grid-quantity-editor[hidden] {
  display: none;
}

.grid-quantity-editor label {
  display: grid;
  gap: 6px;
  color: #9eb0bd;
  font-size: 11px;
  font-weight: 800;
}

.grid-quantity-editor label + label {
  margin-top: 10px;
}

.grid-quantity-editor input {
  width: 100%;
  border-color: #486072;
  color: #f2f7fa;
  background: #1b2936;
}

.grid-quantity-editor small {
  display: block;
  margin-top: 8px;
  color: #8fa1af;
  font-size: 10px;
  line-height: 1.6;
}

.grid-quantity-editor p {
  min-height: 16px;
  margin: 7px 0 0;
  color: #f2bd58;
  font-size: 10px;
  font-weight: 750;
}

.grid-quantity-editor > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.grid-quantity-editor button {
  min-height: 31px;
  padding: 5px 9px;
  font-size: 11px;
}

.grid-pnl-breakdown small {
  display: block;
  margin-top: 4px;
  color: #8fa1b1;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.grid-restart-catchup {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: #b9c8d3;
  background: rgba(15, 118, 110, 0.12);
  font-size: 11px;
}

.grid-manual-reduction-progress {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffc1b8;
  background: rgba(127, 29, 29, 0.14);
  font-size: 11px;
}

.grid-manual-reduction-progress strong {
  flex: 0 0 auto;
}

.grid-manual-reduction-progress span {
  color: #b9c7d1;
}

.grid-restart-catchup strong {
  flex: 0 0 auto;
  color: #3dd6a4;
}

.grid-restart-catchup.executing {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.grid-restart-catchup.executing strong {
  color: #f5bd55;
}

.grid-stop-button {
  min-height: 32px;
  padding: 5px 9px;
  border-color: #526171;
  color: #d7e0e6;
  background: #202c38;
  font-size: 11px;
}

.grid-delete-button {
  min-height: 32px;
  border: 1px solid rgba(242, 85, 121, 0.55);
  border-radius: 7px;
  padding: 5px 9px;
  color: #ff829d;
  background: rgba(242, 85, 121, 0.1);
  font-size: 11px;
  font-weight: 800;
}

.grid-delete-button:hover:not(:disabled) {
  color: #fff;
  background: #b83250;
}

.grid-instance-tags {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 13px 0;
}

.grid-instance-tags span {
  border: 1px solid #3a4856;
  border-radius: 4px;
  padding: 4px 7px;
  color: #c9d3da;
  background: #202c38;
  font-size: 11px;
  font-weight: 750;
}

.grid-instance-tags .live-grid-tag {
  border-color: rgba(239, 68, 68, 0.55);
  color: #ff9ca8;
  background: rgba(190, 24, 93, 0.13);
}

.grid-live-error {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border: 1px solid rgba(244, 63, 94, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.18);
  font-size: 12px;
}

.grid-live-retry {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fde68a;
  background: rgba(146, 64, 14, 0.16);
  font-size: 12px;
}

.grid-pretrade-skip {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 10px 12px;
  color: #bae6fd;
  background: rgba(3, 105, 161, 0.14);
  font-size: 12px;
}

.grid-pretrade-skip[hidden] {
  display: none;
}

.grid-instance-tags small {
  margin-left: auto;
  color: #8394a3;
}

.grid-instance-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #2d3a47;
  border-bottom: 1px solid #2d3a47;
  padding: 13px 0;
}

.grid-instance-stats div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.grid-instance-stats span,
.grid-order-caption {
  color: #8fa0af;
  font-size: 11px;
  font-weight: 700;
}

.grid-instance-stats strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.grid-instance-stats small {
  color: #718594;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.45;
}

.grid-instance-stats em {
  font-style: normal;
}

.grid-trigger-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 13px;
}

.grid-trigger-preview[hidden] {
  display: none;
}

.grid-trigger-preview-side {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  align-items: center;
  gap: 5px 10px;
  border: 1px solid #334250;
  border-left: 3px solid #718594;
  border-radius: 6px;
  padding: 9px 10px;
  color: #c8d4dc;
  background: #111a24;
}

.grid-trigger-preview-side.add {
  border-left-color: #2fc991;
}

.grid-trigger-preview-side.reduce {
  border-left-color: #f0627f;
}

.grid-trigger-preview-side.ready {
  background: rgba(13, 148, 136, 0.12);
}

.grid-trigger-preview-side strong {
  grid-column: 1 / -1;
  color: #e7eef3;
  font-size: 12px;
}

.grid-trigger-preview-side span {
  color: #a8b7c2;
  font-size: 10px;
  font-weight: 750;
}

.grid-trigger-preview-side small {
  grid-column: 1 / -1;
  color: #f0bd64;
  font-size: 10px;
  line-height: 1.45;
}

.grid-initial-order {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 13px 0;
  border-left: 3px solid #8fa0af;
  border-radius: 5px;
  padding: 9px 11px;
  color: #cbd5dc;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.grid-initial-order.waiting {
  border-left-color: #f0b44d;
}

.grid-initial-order.filled {
  border-left-color: #2dc791;
}

.grid-initial-order strong {
  flex: 0 0 auto;
}

.grid-execution-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 13px;
  border: 1px solid #334250;
  border-left: 3px solid #2fc991;
  border-radius: 6px;
  padding: 10px 11px;
  background: #111a24;
}

.grid-execution-status.pending {
  border-left-color: #f0b44d;
}

.grid-execution-status div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.grid-execution-status span {
  color: #8293a2;
  font-size: 10px;
  font-weight: 750;
}

.grid-execution-status strong {
  overflow-wrap: anywhere;
  color: #e2eaf0;
  font-size: 12px;
}

.grid-order-counts {
  margin-top: 14px;
}

.grid-order-balance {
  display: block;
  appearance: none;
  width: 100%;
  height: 7px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #ec4c72;
}

.grid-order-balance::-webkit-meter-bar {
  background: #ec4c72;
  border: 0;
  border-radius: 999px;
}

.grid-order-balance::-webkit-meter-optimum-value,
.grid-order-balance::-moz-meter-bar {
  background: #2fc991;
  border-radius: 999px;
}

.grid-add-price {
  color: #31cf98;
}

.grid-reduce-price {
  color: #f25579;
}

.grid-order-caption {
  margin: 9px 0 3px;
}

.grid-level-details {
  margin-top: 10px;
  border: 1px solid #334250;
  border-radius: 8px;
  background: #111a24;
}

.grid-level-details > summary {
  padding: 11px 13px;
  color: #b8c5d0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.grid-level-details[open] > summary {
  border-bottom: 1px solid #283542;
}

.grid-level-content > p {
  margin: 0;
  padding: 14px;
  color: #8fa0af;
  font-size: 12px;
}

.grid-level-content .grid-direction-columns {
  margin: 12px;
}

.grid-direction-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin-top: 10px;
}

.grid-direction-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #334250;
  border-radius: 8px;
  background: #111a24;
}

.grid-direction-panel.add-panel {
  border-top: 3px solid #2fc991;
}

.grid-direction-panel.reduce-panel {
  border-top: 3px solid #ec4c72;
}

.grid-direction-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid #283542;
}

.grid-direction-panel-head strong {
  font-size: 13px;
}

.add-panel .grid-direction-panel-head strong {
  color: #31cf98;
}

.reduce-panel .grid-direction-panel-head strong {
  color: #f25579;
}

.grid-direction-panel-head span {
  color: #8fa0af;
  font-size: 11px;
  font-weight: 750;
}

.grid-direction-scroll {
  max-height: min(52vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
  will-change: scroll-position;
}

.grid-current-level {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid #465665;
  border-radius: 7px;
  padding: 8px 11px;
  background: #202c38;
}

.grid-current-level span,
.grid-current-level small {
  color: #94a5b3;
  font-size: 11px;
  font-weight: 750;
}

.grid-current-level strong {
  color: #f2f7f9;
  font-size: 13px;
}

.grid-current-level small {
  justify-self: end;
}

.grid-order-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.grid-order-table th,
.grid-order-table td {
  border-bottom: 1px solid #283542;
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
}

.grid-order-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #7f909f;
  background: #17212d;
  font-size: 11px;
}

.grid-order-table td {
  color: #dce5ea;
  font-size: 13px;
  font-weight: 720;
}

.grid-order-table tbody tr,
.grid-order-table tbody tr:nth-child(even),
.grid-order-table tbody tr:nth-child(odd),
.grid-order-table tbody td {
  background: transparent;
}

.grid-order-table th:nth-child(1),
.grid-order-table td:nth-child(1),
.grid-order-table th:nth-child(2),
.grid-order-table td:nth-child(2) {
  text-align: left;
}

.grid-order-table .grid-add-price {
  color: #31cf98;
}

.grid-order-table .grid-reduce-price {
  color: #f25579;
}

.grid-order-table .grid-order-index {
  width: 42px;
  color: #8293a2;
  text-align: center;
}

.grid-order-table .grid-distance {
  color: #b4c0c9;
  font-size: 12px;
}

.grid-order-table .grid-distance small {
  display: block;
  margin-top: 2px;
  color: #738493;
  font-size: 10px;
}

.grid-open-positions {
  margin: 13px 0;
  border: 1px solid #334250;
  border-radius: 7px;
  padding: 11px;
  background: #111a24;
}

.binance-account-overview {
  margin: 14px 0 0;
  color: #dce5ea;
}

.grid-open-positions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.grid-open-positions-head strong {
  color: #f0f6f8;
  font-size: 13px;
}

.grid-open-positions-head span {
  color: #8fa0af;
  font-size: 12px;
  font-weight: 750;
}

.binance-account-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.binance-account-switch select,
.binance-account-switch .styled-select {
  min-width: 220px;
  max-width: min(420px, 48vw);
}

.binance-account-switch .styled-select-trigger {
  height: 38px;
  border: 1px solid #405264;
  border-radius: 9px;
  padding: 0 12px;
  color: #f0f6f8;
  background: linear-gradient(180deg, #263544, #202c38);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.binance-account-switch button.styled-select-trigger:hover:not(:disabled),
.binance-account-switch button.styled-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(180deg, #2a3b4b, #22313f);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.22);
}

.binance-account-switch .select-chevron {
  border-color: #7fd3d1;
}

.binance-account-switch .styled-select-menu {
  right: auto;
  left: 0;
  min-width: 100%;
  border-color: #405264;
  color: #dce5ea;
  background: #17212d;
  box-shadow: 0 16px 38px rgba(2, 8, 15, 0.4), 0 4px 12px rgba(2, 8, 15, 0.28);
}

.binance-account-switch .styled-select-menu button {
  color: #dce5ea;
}

.binance-account-switch .styled-select-menu button:hover:not(:disabled),
.binance-account-switch .styled-select-menu button.selected {
  color: #b8f1ed;
  background: rgba(15, 139, 141, 0.18);
}

.binance-account-switch .styled-select-menu button.selected::before {
  border-color: #45c7bf;
}

.binance-position-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.binance-account-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.binance-account-summary article,
.binance-account-summary .binance-account-funding-card {
  display: grid;
  gap: 4px;
  border: 1px solid #334250;
  border-radius: 7px;
  padding: 9px 10px;
  background: #202c38;
}

.binance-account-summary .binance-account-funding-card {
  position: relative;
  align-content: start;
  width: 100%;
  height: auto;
  min-height: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.binance-account-summary .binance-account-funding-card:hover,
.binance-account-summary .binance-account-funding-card:focus-visible {
  border-color: #45c7bf;
  outline: none;
  background: #243542;
  box-shadow: 0 0 0 3px rgba(69, 199, 191, 0.12);
  transform: none;
}

.binance-account-funding-card em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-top: 2px;
  color: #45c7bf;
  font-size: 10px;
  font-style: normal;
  font-weight: 780;
}

.binance-account-funding-card em span {
  color: inherit;
  font-size: 13px;
  transition: translate 160ms ease;
}

.binance-account-funding-card:hover em span,
.binance-account-funding-card:focus-visible em span {
  translate: 3px 0;
}

.binance-account-summary span,
.binance-account-subhead span,
.binance-asset-row span {
  color: #8fa0af;
  font-size: 11px;
  font-weight: 720;
}

.binance-account-summary strong {
  color: #eef5f7;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.binance-account-summary small {
  color: #8fa0af;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
}

.binance-account-summary strong.positive,
.binance-position-metrics strong.positive {
  color: #31cf98;
}

.binance-account-summary strong.negative,
.binance-position-metrics strong.negative {
  color: #f25579;
}

.binance-funding-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 2px;
  border: 1px solid rgba(69, 199, 191, 0.24);
  border-radius: 7px;
  padding: 7px 10px;
  color: #8fa0af;
  background: rgba(15, 139, 141, 0.08);
  font-size: 10px;
  font-weight: 720;
}

.binance-funding-period strong {
  color: #b8f1ed;
  font-size: 11px;
}

.binance-funding-history-modal {
  z-index: 2600;
  padding: 20px;
  color: var(--color-base-content);
  background: transparent;
}

.binance-funding-history-modal::backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
}

.binance-funding-history-modal .modal-backdrop,
.binance-funding-history-modal .modal-backdrop button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.modal .binance-funding-history-card {
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 40px));
  max-width: 920px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--color-base-300);
  border-radius: calc(var(--radius-box) * 2);
  padding: 0;
  color: var(--color-base-content);
  background: var(--color-base-100);
  box-shadow: 0 26px 90px rgba(15, 23, 42, 0.28);
}

.binance-funding-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--color-base-300);
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, var(--color-base-100), var(--color-base-200));
}

.binance-funding-history-head .eyebrow {
  margin-bottom: 5px;
}

.binance-funding-history-head h3 {
  margin: 0;
  color: var(--color-base-content);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.25;
}

.binance-funding-history-head p:last-child {
  margin: 7px 0 0;
  color: color-mix(in oklab, var(--color-base-content) 58%, transparent);
  font-size: 13px;
  font-weight: 650;
}

.binance-funding-history-head .binance-funding-history-close {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--color-base-300);
  border-radius: 50%;
  padding: 0;
  color: color-mix(in oklab, var(--color-base-content) 68%, transparent);
  background: var(--color-base-100);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.binance-funding-history-head .binance-funding-history-close:hover,
.binance-funding-history-head .binance-funding-history-close:focus-visible {
  border-color: color-mix(in oklab, var(--color-primary) 45%, var(--color-base-300));
  color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 8%, var(--color-base-100));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transform: none;
}

.binance-funding-history-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
}

.binance-funding-history-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
  scrollbar-gutter: stable;
}

.binance-funding-history-summary {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.binance-funding-history-summary .stat {
  min-width: 0;
  padding: 15px 17px;
}

.binance-funding-history-summary .stat-title,
.binance-funding-history-selection {
  color: color-mix(in oklab, var(--color-base-content) 58%, transparent);
  font-size: 12px;
  font-weight: 720;
}

.binance-funding-history-summary .stat-value {
  min-width: 0;
  margin-top: 5px;
  color: var(--color-base-content);
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 820;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.binance-funding-history-card .positive {
  color: var(--color-success);
}

.binance-funding-history-card .negative {
  color: var(--color-error);
}

.binance-funding-history-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.binance-funding-history-filters > div {
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.binance-funding-history-filters > div::-webkit-scrollbar {
  display: none;
}

.binance-funding-history-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
}

.binance-funding-history-filters button {
  min-height: 38px;
  border: 1px solid var(--color-base-300);
  border-radius: 10px;
  padding-inline: 15px;
  white-space: nowrap;
}

.binance-funding-history-filters button.btn-ghost {
  color: color-mix(in oklab, var(--color-base-content) 74%, transparent);
  background: var(--color-base-100);
}

.binance-funding-history-filters button.btn-primary {
  border-color: var(--color-primary);
  color: var(--color-primary-content);
  box-shadow: 0 3px 8px color-mix(in oklab, var(--color-primary) 20%, transparent);
}

.binance-funding-history-selection {
  margin: 13px 0 8px;
  border-radius: var(--radius-field);
  padding: 8px 10px;
  background: var(--color-base-200);
}

.binance-funding-history-selection strong {
  margin-left: 3px;
}

.binance-funding-history-table-wrap {
  max-height: min(50vh, 500px);
  overflow: auto;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
}

.binance-funding-history-table {
  width: 100%;
  color: var(--color-base-content);
  font-size: 13px;
}

.binance-funding-history-table th,
.binance-funding-history-table td {
  border-bottom-color: var(--color-base-300);
  padding: 11px 13px;
  text-align: left;
  white-space: nowrap;
}

.binance-funding-history-table th {
  color: color-mix(in oklab, var(--color-base-content) 62%, transparent);
  background: var(--color-base-200);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.binance-funding-history-table td strong {
  color: var(--color-base-content);
}

.binance-funding-history-table .badge-success,
.binance-funding-history-table .badge-error {
  color: #fff;
  font-weight: 800;
}

.binance-funding-history-table th:last-child,
.binance-funding-history-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.binance-funding-history-empty {
  margin: 0;
  padding: 32px 12px;
  color: color-mix(in oklab, var(--color-base-content) 58%, transparent);
  text-align: center;
}

.binance-account-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 7px;
}

.binance-account-subhead strong {
  color: #f0f6f8;
  font-size: 12px;
}

.binance-position-subhead > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.binance-close-all-button {
  min-height: 30px;
  border: 1px solid #a62b21;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 720px) {
  .binance-position-subhead,
  .binance-position-subhead > div {
    align-items: stretch;
    flex-direction: column;
  }
}

.binance-asset-list {
  display: grid;
  gap: 7px;
}

.binance-asset-row {
  display: grid;
  grid-template-columns: 70px repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  border: 1px solid #334250;
  border-radius: 7px;
  padding: 9px 10px;
  background: #202c38;
}

.binance-asset-row strong {
  color: #f0f6f8;
  font-size: 13px;
}

.binance-asset-row span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.binance-asset-row b {
  color: #dce5ea;
  font-variant-numeric: tabular-nums;
}

.binance-position-row {
  min-width: 0;
  border: 1px solid #334250;
  border-radius: 7px;
  padding: 10px;
  color: #dce5ea;
  background: #202c38;
}

.binance-position-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.binance-position-title strong {
  color: #f0f6f8;
  font-size: 13px;
}

.binance-position-title b {
  color: #cbd5dc;
  font-size: 12px;
}

.binance-position-title em {
  margin-left: auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.binance-position-side {
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 850;
}

.binance-position-side.long {
  color: #31cf98;
  background: rgba(49, 207, 152, 0.13);
}

.binance-position-side.short {
  color: #f25579;
  background: rgba(242, 85, 121, 0.13);
}

.binance-position-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  margin-top: 8px;
  color: #8fa0af;
  font-size: 11px;
}

.binance-position-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.binance-position-metrics strong {
  color: #dce5ea;
}

.account-position-warning {
  border-color: rgba(240, 180, 77, 0.45);
  color: #e9bd69;
}

.grid-position-empty {
  border: 1px dashed #334250;
  border-radius: 6px;
  padding: 12px;
  color: #8fa0af;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .binance-account-positions-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .binance-account-switch,
  .binance-account-switch select,
  .binance-account-switch .styled-select {
    width: 100%;
    max-width: none;
  }

  .binance-account-switch {
    align-items: stretch;
    flex-direction: column;
  }

  .binance-account-summary,
  .binance-position-list {
    grid-template-columns: 1fr;
  }

  .binance-funding-period {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal .binance-funding-history-card {
    width: min(920px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .binance-funding-history-table-wrap {
    max-height: 46vh;
  }

  .binance-asset-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .binance-funding-history-modal {
    padding: 8px;
  }

  .modal .binance-funding-history-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .binance-funding-history-head {
    padding: 16px;
  }

  .binance-funding-history-head h3 {
    font-size: 19px;
  }

  .binance-funding-history-body {
    padding: 14px 16px 16px;
  }

  .binance-funding-history-summary {
    grid-template-columns: 1fr;
  }

  .binance-funding-history-summary .stat:not(:last-child) {
    border-right: 0;
    border-bottom: 1px dashed var(--color-base-300);
  }

  .binance-funding-history-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .binance-funding-history-table-wrap {
    max-height: 48vh;
  }
}

.grid-direction-scroll::-webkit-scrollbar,
.trading-recent-trades::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.grid-direction-scroll::-webkit-scrollbar-thumb,
.trading-recent-trades::-webkit-scrollbar-thumb {
  border: 2px solid #17212d;
  border-radius: 999px;
  background: #536373;
}

.grid-direction-scroll::-webkit-scrollbar-track,
.trading-recent-trades::-webkit-scrollbar-track {
  background: #202c38;
}

.trading-grid-instance .positive {
  color: #31cf98;
}

.trading-grid-instance .negative {
  color: #f25579;
}

.notification-target-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  min-width: 0;
}

.notification-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 96px;
  gap: 12px;
  align-items: center;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  background: #fff;
  padding: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.notification-target.single-threshold-target,
.notification-target.threshold-target {
  grid-template-columns: minmax(0, 1fr) auto 96px;
}

.notification-target.index-target {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.alpha-index-target-content {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.alpha-index-live-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
}

.alpha-index-constituent,
.alpha-index-live-status {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #dce5ec;
  border-radius: 5px;
  background: #fff;
  padding: 5px 8px;
  color: #52657a;
  font-size: 12px;
  line-height: 1.35;
}

.alpha-index-constituent b {
  color: #26384d;
}

.notification-target small.alpha-index-updated {
  margin-top: 8px;
  color: #78889a;
  font-size: 11px;
}

.notification-target.index-target > button {
  align-self: center;
}

@media (max-width: 900px) {
  .alpha-index-target-content {
    grid-template-columns: 1fr;
  }

  .alpha-index-constituent,
  .alpha-index-live-status {
    grid-template-columns: 1fr;
  }
}

.notification-target strong {
  display: block;
}

.notification-target small {
  display: block;
}

.notification-target input {
  height: 42px;
  width: 100%;
  min-width: 0;
}

.notification-target-fields {
  display: flex;
  gap: 10px;
  align-items: end;
}

.notification-target-fields label {
  width: 150px;
  min-width: 0;
}

.notification-target > button,
.notification-target button[data-remove-price-target],
.notification-target button[data-remove-funding-target],
.notification-target button[data-remove-notification-target],
.notification-target button[data-remove-alpha-spread-target],
.notification-target button[data-remove-alpha-index-target] {
  align-self: end;
  justify-self: end;
  width: 96px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  background: #7a271a;
}

.notification-target > button:hover:not(:disabled),
.notification-target button[data-remove-price-target]:hover:not(:disabled),
.notification-target button[data-remove-funding-target]:hover:not(:disabled),
.notification-target button[data-remove-notification-target]:hover:not(:disabled),
.notification-target button[data-remove-alpha-spread-target]:hover:not(:disabled),
.notification-target button[data-remove-alpha-index-target]:hover:not(:disabled) {
  background: #55160c;
}

@media (max-width: 1180px) {
  .notification-block,
  .notification-target-form,
  .funding-target-form,
  .price-target-form,
  .price-target-fields,
  .alpha-spread-target-form,
  .alpha-index-target-form,
  .notification-target,
  .notification-target.single-threshold-target,
  .notification-target.index-target,
  .notification-target.threshold-target {
    grid-template-columns: 1fr;
  }

  .notification-panel button,
  .notification-target-form button,
  .notification-target button {
    width: 100%;
    justify-self: stretch;
  }

  .notification-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .notification-target-fields {
    width: 100%;
  }
}

.contract-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 140px auto minmax(180px, auto);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.contract-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.contract-row select {
  width: 100%;
  font-weight: 750;
}

.compact-field {
  min-width: 132px;
}

.config-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hint {
  color: var(--muted);
}

.summary article,
.alpha-summary article,
.opportunity-panel,
.opportunity,
.venue,
.signal,
.section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.opportunity-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.opportunity-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 170px)) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.opportunity-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.opportunity-controls input {
  width: 100%;
  min-height: 42px;
}

.opportunity-controls .hint {
  align-self: center;
  margin: 0;
}

.opportunity-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.opportunity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-left: 5px solid var(--line);
  padding: 13px 14px;
}

.opportunity.high {
  border-left-color: var(--red);
}

.opportunity.medium {
  border-left-color: var(--amber);
}

.opportunity.low,
.opportunity.empty {
  border-left-color: var(--green);
}

.opportunity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.opportunity h3 {
  margin: 3px 0 5px;
  font-size: 17px;
}

.opportunity p {
  margin-bottom: 4px;
  font-weight: 750;
}

.opportunity-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 112px;
}

.opportunity-side strong {
  font-size: 18px;
}

.summary article {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.alpha-summary article {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.summary span,
.alpha-summary span {
  color: var(--muted);
  font-size: 13px;
}

.summary strong,
.alpha-summary strong {
  font-size: 28px;
}

.section {
  padding: 18px;
  margin-top: 16px;
}

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

.section-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.section-head p {
  max-width: 520px;
  margin-bottom: 0;
  text-align: right;
}

.section-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.section-tools label {
  display: grid;
  gap: 6px;
  min-width: 118px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-tools input {
  width: 112px;
}

.funding-days-control {
  position: relative;
  flex: 0 0 auto;
}

.funding-days-trigger {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 5px;
  min-width: 112px;
  min-height: 42px;
  border: 1px solid #d8e2e8;
  border-radius: 9px;
  padding: 6px 29px 6px 11px;
  color: #718095;
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 54, 71, 0.045);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.funding-days-trigger:hover:not(:disabled),
.funding-days-trigger[aria-expanded="true"] {
  border-color: #8bbfc0;
  background: #f7fbfb;
  box-shadow: 0 3px 12px rgba(19, 116, 119, 0.1);
}

.funding-days-trigger > span:first-child {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.05;
}

.funding-days-trigger strong {
  color: #172332;
  font-size: 14px;
  line-height: 1.15;
}

.funding-days-chevron {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: #7b8999;
  font-size: 14px;
  line-height: 1;
  transition: transform 140ms ease;
}

.funding-days-trigger[aria-expanded="true"] .funding-days-chevron {
  transform: rotate(180deg);
}

.funding-days-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 202px;
  border: 1px solid #d9e3ea;
  border-radius: 9px;
  padding: 11px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 42, 57, 0.14);
}

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

.funding-days-popover label {
  display: block;
  margin-bottom: 7px;
  color: #43566a;
  font-size: 11px;
  font-weight: 700;
}

.funding-days-editor {
  display: flex;
  gap: 8px;
}

.funding-days-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd8e1;
  border-radius: 7px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.funding-days-input-wrap:focus-within {
  border-color: #79b8ba;
  box-shadow: 0 0 0 3px rgba(23, 143, 146, 0.1);
}

.section-tools .funding-days-input-wrap #fundingDaysInput {
  width: 100%;
  min-height: 36px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 6px 4px 6px 9px;
  box-shadow: none;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.funding-days-input-wrap span {
  padding-right: 8px;
  color: #6a798a;
  font-size: 11px;
  font-weight: 650;
}

.funding-days-confirm {
  min-height: 36px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 0 11px;
  color: #fff;
  background: #178f92;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(17, 122, 125, 0.16);
}

.funding-days-confirm:hover:not(:disabled) {
  background: #117a7d;
}

.funding-days-popover small {
  display: block;
  margin-top: 7px;
  color: #8491a1;
  font-size: 10px;
}

@media (max-width: 900px) {
  .funding-days-control,
  .funding-days-trigger {
    width: 100%;
  }

  .funding-days-popover {
    right: auto;
    left: 0;
    width: min(280px, 100%);
  }
}

.alpha-head {
  align-items: center;
}

.alpha-head > div:first-child {
  min-width: 0;
}

.alpha-head p {
  max-width: none;
  margin-top: 6px;
  text-align: left;
  overflow-wrap: anywhere;
}

.alpha-head .button-row {
  flex-shrink: 0;
}

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

.venue {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  padding: 16px;
}

.venue.unavailable {
  border-color: #f2b8b5;
  background: #fff7f6;
}

.venue-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 12px;
}

.venue-title h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.venue-title span {
  color: var(--muted);
  font-size: 13px;
}

.venue strong {
  display: block;
  min-height: 34px;
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.25;
}

.venue-source {
  min-height: 36px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #eef1f5;
  padding-top: 8px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
}

.hot {
  color: var(--amber);
}

.funding-positive-hot {
  color: #a61111;
  background: #fff0f0;
  border-radius: 5px;
  font-weight: 900;
}

.funding-negative-hot {
  color: #075f46;
  background: #ecfdf3;
  border-radius: 5px;
  font-weight: 850;
}

.spread-hot {
  color: #7a271a;
  background: #fff1e8;
  border-radius: 5px;
  font-weight: 900;
}

.spread-watch {
  color: #93370d;
  background: #fff7ed;
  border-radius: 5px;
  font-weight: 850;
}

.signal-list {
  display: grid;
  gap: 10px;
}

.alpha-signal-rule-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 920px;
}

.alpha-signal-rule-chips span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #cce9e1;
  border-radius: 999px;
  color: #52657a;
  background: #f2faf8;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.alpha-signal-rule-chips b {
  color: var(--accent-dark);
}

.alpha-signal-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.alpha-signal-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.alpha-signal-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.alpha-signal-group-head h3,
.alpha-signal-group-head p {
  margin: 0;
}

.alpha-signal-group-head h3 {
  font-size: 16px;
}

.alpha-signal-group-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.alpha-signal-group-head small {
  display: block;
  margin-top: 7px;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.alpha-signal-group-head > strong,
.alpha-focus-head > strong {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #dff5f1;
}

.alpha-signal-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.alpha-signal-title em {
  font-style: normal;
}

.alpha-change-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #dff5f1;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.alpha-change-badge.positive {
  color: var(--green);
  background: #eaf8f0;
}

.alpha-change-badge.negative {
  color: var(--red);
  background: #fff1f0;
}

.alpha-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #d9e2ea;
  border-radius: 999px;
  color: #344054;
  background: #f7f9fb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.alpha-signal-group .signal-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #91d4bf transparent;
  scrollbar-gutter: stable;
}

.alpha-signal-group .signal-list::-webkit-scrollbar {
  width: 8px;
}

.alpha-signal-group .signal-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: transparent;
}

.alpha-signal-group .signal-list::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 2px solid #f8fafc;
  border-radius: 999px;
  background: #91d4bf;
}

.alpha-signal-group .signal-list::-webkit-scrollbar-thumb:hover {
  background: #69bea4;
}

.alpha-signal-group .signal-list::-webkit-scrollbar-button {
  display: none;
}

.alpha-focus-row {
  grid-column: 1 / -1;
  border: 1px solid #a9dfcf;
  border-radius: 8px;
  padding: 14px;
  background: #eefaf6;
}

.alpha-focus-head,
.alpha-focus-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alpha-focus-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.alpha-focus-head h3,
.alpha-focus-head p {
  margin: 0;
}

.alpha-focus-head h3 {
  color: #075f45;
  font-size: 17px;
}

.alpha-focus-head p {
  margin-top: 3px;
  color: #39735f;
  font-size: 12px;
  font-weight: 750;
}

.alpha-focus-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.alpha-focus-item {
  display: grid;
  gap: 9px;
  border: 1px solid #c5e9de;
  border-radius: 7px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.alpha-focus-title {
  flex-wrap: wrap;
}

.alpha-focus-title > b {
  font-size: 18px;
}

.alpha-focus-title > strong {
  margin-left: auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: #067647;
  background: #dcfae6;
  font-size: 11px;
  white-space: nowrap;
}

.alpha-focus-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.alpha-focus-conditions span {
  border: 1px solid #b8e2d5;
  border-radius: 999px;
  padding: 3px 7px;
  color: #246b55;
  background: #f5fcfa;
  font-size: 11px;
  font-weight: 750;
}

.alpha-focus-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #39735f;
}

.signal {
  padding: 15px;
  border-left: 5px solid var(--line);
}

.signal.medium {
  border-left-color: var(--amber);
}

.signal.watch {
  border-left-color: var(--accent);
}

.signal.high {
  border-left-color: var(--red);
}

.signal.low {
  border-left-color: var(--green);
}

.alpha-signal-group .signal {
  box-sizing: border-box;
  height: 160px;
  border-color: #a9dfcf;
  border-left-width: 1px;
  border-left-color: #62c5a6;
}

.signal span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.signal h3 {
  margin: 4px 0 8px;
  font-size: 18px;
}

.signal .action {
  color: var(--ink);
  font-weight: 800;
}

.signal p:last-child {
  margin-bottom: 0;
}

.alpha-filters {
  display: flex;
  align-items: end;
  gap: 10px;
}

.alpha-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.alpha-table {
  width: 100%;
  min-width: 1510px;
  border-collapse: collapse;
}

.alpha-table th,
.alpha-table td {
  border-bottom: 1px solid #eef1f5;
  padding: 11px 10px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.alpha-table th:first-child,
.alpha-table td:first-child,
.alpha-table th:last-child,
.alpha-table td:last-child {
  text-align: left;
}

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

.alpha-table td:first-child small {
  font-size: 12px;
}

.alpha-table .alpha-symbol-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.alpha-table .alpha-symbol-link strong {
  color: var(--ink);
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

.alpha-table .alpha-symbol-link:hover strong,
.alpha-table .alpha-symbol-link:focus-visible strong {
  color: #075f61;
  text-decoration-color: currentColor;
}

.alpha-table .alpha-symbol-link small {
  color: var(--muted);
}

.alpha-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .32);
}

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

.alpha-modal-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}

.funding-detail-modal-card {
  width: min(760px, 100%);
}

.funding-summary-row {
  padding-top: 4px;
}

.funding-summary-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 5px 3px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.funding-summary-label {
  display: grid;
  color: var(--muted);
}

.funding-summary-label-default,
.funding-summary-label-hover {
  grid-area: 1 / 1;
}

.funding-summary-label-hover {
  opacity: 0;
}

.funding-summary-value {
  font-weight: 700;
}

.funding-summary-trigger:hover:not(:disabled),
.funding-summary-trigger:focus-visible {
  outline: none;
  color: #fff;
  background: rgba(17, 139, 141, .72);
  box-shadow: 0 3px 10px rgba(15, 107, 109, .16);
}

.funding-summary-trigger:hover:not(:disabled) .funding-summary-label,
.funding-summary-trigger:hover:not(:disabled) .funding-summary-value,
.funding-summary-trigger:focus-visible .funding-summary-label,
.funding-summary-trigger:focus-visible .funding-summary-value {
  color: #fff;
}

.funding-summary-trigger:hover:not(:disabled) .funding-summary-label-default,
.funding-summary-trigger:focus-visible .funding-summary-label-default {
  opacity: 0;
}

.funding-summary-trigger:hover:not(:disabled) .funding-summary-label-hover,
.funding-summary-trigger:focus-visible .funding-summary-label-hover {
  opacity: 1;
}

.funding-detail-modal-body {
  padding-top: 14px;
}

.funding-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.funding-detail-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfe;
}

.funding-detail-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.funding-detail-summary strong {
  font-size: 18px;
}

.funding-detail-table-wrap {
  max-height: min(55vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.funding-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.funding-detail-table th,
.funding-detail-table td {
  border-bottom: 1px solid #e8edf2;
  padding: 9px 11px;
  text-align: right;
  white-space: nowrap;
}

.funding-detail-table th:first-child,
.funding-detail-table td:first-child {
  text-align: left;
}

.funding-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f6f8fa;
  font-size: 12px;
}

.funding-detail-empty {
  margin: 0;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 520px) {
  .funding-detail-summary {
    grid-template-columns: 1fr;
  }
}

.alpha-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.alpha-modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.alpha-modal-head p {
  margin-top: 4px;
  color: var(--muted);
}

.alpha-oi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
}

.alpha-oi-grid article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.alpha-oi-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.alpha-oi-grid strong {
  font-size: 22px;
}

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

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 190px;
}

.tag {
  border: 1px solid #c9d3df;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--accent-dark);
  background: #edf7f7;
  font-size: 12px;
  font-weight: 750;
}

.chip-query-panel {
  max-width: 820px;
}

.chip-query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: end;
}

.chip-query-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.chip-combobox {
  position: relative;
  min-width: 0;
}

.chip-combobox input {
  width: 100%;
}

.chip-search-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}

.chip-search-menu[hidden] {
  display: none;
}

.chip-search-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 50px;
  border-radius: 5px;
  padding: 7px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.chip-search-option:hover,
.chip-search-option:focus-visible {
  color: var(--ink);
  background: #edf7f7;
}

.chip-search-option span {
  display: grid;
  gap: 1px;
}

.chip-search-option small,
.chip-search-option em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.chip-search-option em {
  flex: 0 0 auto;
  font-size: 12px;
}

.chip-search-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.chip-result {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.chip-result-head {
  align-items: center;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.chip-result-head > div:first-child {
  min-width: 0;
}

.chip-result-head p {
  max-width: 760px;
  margin-top: 5px;
  text-align: left;
  overflow-wrap: anywhere;
}

.chip-risk-badge {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #f6f7f9;
}

.chip-risk-badge strong {
  font-size: 26px;
  line-height: 1;
}

.chip-risk-badge span {
  font-weight: 800;
}

.chip-risk-badge.medium {
  border-color: #f4c790;
  color: var(--amber);
  background: #fff8ed;
}

.chip-risk-badge.high {
  border-color: #f3b5af;
  color: var(--red);
  background: #fff1f0;
}

.chip-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.chip-summary article {
  display: grid;
  gap: 6px;
  min-height: 108px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fbfcfe;
}

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

.chip-summary strong {
  font-size: 25px;
}

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

.chip-analysis-block {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 132px;
  padding: 14px 16px;
  background: #fbfcfe;
}

.chip-analysis-block h3,
.chip-table-section h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.chip-reason-list {
  display: grid;
  gap: 7px;
}

.chip-reason-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.chip-reason-list p::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.chip-reason-list p.risk {
  color: var(--red);
}

.chip-reason-list p.risk::before {
  background: var(--red);
}

.chip-reason-list a {
  color: inherit;
  font-weight: 850;
  text-decoration: none;
}

.compact-head {
  align-items: end;
  margin-bottom: 8px;
}

.compact-head p {
  text-align: right;
}

.chip-table-section {
  min-width: 0;
}

.chip-holder-table {
  width: 100%;
  min-width: 760px;
}

.chip-holder-table th:first-child,
.chip-holder-table td:first-child {
  display: table-cell;
  width: 54px;
}

.chip-holder-table td:nth-child(2) {
  display: table-cell;
  min-width: 180px;
}

.chip-address-cell {
  display: grid;
  gap: 2px;
}

.chip-holder-table th:nth-child(4),
.chip-holder-table th:nth-child(5),
.chip-holder-table td:nth-child(4),
.chip-holder-table td:nth-child(5) {
  text-align: right;
}

.chip-holder-table a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.chip-type {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #eef1f5;
  font-size: 12px;
  font-weight: 800;
}

.chip-type.creator {
  color: var(--red);
  background: #fff1f0;
}

.chip-type.contract {
  color: var(--amber);
  background: #fff8ed;
}

.chip-type.dealerContract {
  color: var(--red);
  background: #fff1f0;
}

.chip-type.liquidity {
  color: var(--accent-dark);
  background: #e8f7f4;
}

.chip-type.burn {
  color: #fff;
  background: #667085;
}

.chip-type.exchange {
  color: var(--accent-dark);
  background: #dff5f1;
}

.chip-dex-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chip-dex-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.chip-dex-list small,
.chip-dex-list span,
.chip-disclaimer {
  color: var(--muted);
}

.chip-result[hidden] {
  display: none;
}

.chip-disclaimer {
  margin: 0;
  font-size: 12px;
}

.muted-tag {
  color: var(--muted);
  background: #f6f7f9;
}

@media (max-width: 900px) {
  .summary,
  .alpha-summary,
  .chip-summary,
  .chip-analysis-grid,
  .chip-dex-list,
  .chip-query-form,
  .venue-grid,
  .config-grid,
  .stock-config-summary,
  .hyperliquid-contract-profile-grid,
  .notification-block,
  .notification-target-form,
  .funding-target-form,
  .alpha-spread-target-form,
  .alpha-index-target-form,
  .trading-form,
  .trading-strategy-grid,
  .trading-strategy-grid.risk-grid,
  .trading-toggles,
  .trading-live-grid,
  .trading-grid-summary,
  .trading-grid-position-metrics,
  .trading-grid-position-row,
  .grid-instance-stats,
  .trade-leg-list,
  .notification-rule-grid,
  .two-field-grid,
  .notification-target,
  .notification-target.single-threshold-target,
  .notification-target.index-target,
  .contract-row,
  .opportunity-controls,
  .opportunity,
  .alpha-signal-groups {
    grid-template-columns: 1fr;
  }

  .trading-grid-position-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .trading-grid-position-overview-head > span {
    text-align: left;
  }

  .exchange-credential-fields,
  .exchange-credential-fields.with-passphrase,
  .alpaca-credential-fields,
  .exchange-credential-summary,
  .binance-live-order-form,
  .binance-live-order-row,
  .trading-v2-form,
  .trading-v2-history-row {
    grid-template-columns: 1fr;
  }

  .trading-v2-position-grid {
    grid-template-columns: 1fr;
  }

  .trading-v2-position-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .trading-v2-block-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .trading-v2-block-heading small {
    text-align: left;
  }

  .trading-v2-position-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .exchange-credentials-head,
  .exchange-credential-title,
  .exchange-credential-actions,
  .binance-live-order-card .trading-card-head,
  .trading-manual-test-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .trading-v2-guard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .trading-v2-monitor-window > header,
  .trading-v2-monitor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .trading-v2-monitor-actions {
    width: 100%;
    justify-content: space-between;
  }

  .trading-v2-monitor-parameter-editor {
    grid-template-columns: auto minmax(88px, 1fr);
  }

  .trading-v2-monitor-parameter-editor button,
  .trading-v2-monitor-parameter-editor small {
    grid-column: 1 / -1;
  }

  .trading-v2-monitor-stats {
    grid-template-columns: 1fr 1fr;
  }

  .trading-strategy-tabs {
    overflow-x: auto;
    padding-bottom: 7px;
  }

  .trading-strategy-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .trading-manual-test-summary-actions {
    justify-content: space-between;
  }

  .credential-title-actions {
    justify-content: space-between;
  }

  .credential-security-badge,
  .credential-state {
    align-self: flex-start;
  }

  .opportunity-side {
    justify-items: start;
  }

  .section-head,
  .topbar,
  .controls,
  .section-tools,
  .stock-config-summary {
    flex-direction: column;
  }

  .mode-switch,
  .button-row,
  .alpha-filters {
    width: 100%;
  }

  .mode-switch {
    flex-wrap: wrap;
  }

  .controls,
  .section-tools,
  .button-row,
  .alpha-filters {
    align-items: stretch;
  }

  .mode-switch button,
  .button-row button,
  .alpha-filters label {
    flex: 1;
  }

  .controls label,
  .controls button,
  .section-tools label,
  .section-tools input,
  .notification-block input,
  .notification-card input,
  .notification-card select,
  .trading-form input,
  .trading-form select,
  .trading-card input,
  .trading-card select,
  .notification-target-form button,
  .notification-target input,
  .notification-target button,
  .notification-target-fields,
  .notification-target-fields label,
  .contract-row button,
  .config-grid button,
  .contract-row select,
  .config-grid input,
  .config-grid select,
  .alpha-filters select {
    width: 100%;
  }

  .section-head p {
    text-align: left;
  }

  .opportunity-controls .hint {
    align-self: start;
  }

  .stock-config-summary p {
    max-width: none;
    text-align: left;
  }

  .notification-target-fields {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  body {
    background: #f7f9fc;
  }

  button {
    min-height: 44px;
  }

  input,
  select {
    min-height: 44px;
    font-size: 16px;
  }

  .shell {
    width: 100%;
    padding: 18px 10px 32px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 16px;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  .topbar p {
    font-size: 14px;
    line-height: 1.45;
  }

  .controls {
    width: 100%;
    gap: 8px;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chip-result-head {
    align-items: stretch;
  }

  .chip-risk-badge {
    justify-content: center;
  }

  .compact-head p {
    text-align: left;
  }

  .mode-switch button {
    padding: 9px 8px;
    font-size: 14px;
  }

  .opportunity-panel,
  .config-panel,
  .section {
    border-radius: 7px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .section {
    margin-top: 12px;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-head h2 {
    font-size: 18px;
  }

  .section-head p,
  .hint {
    font-size: 13px;
    line-height: 1.45;
  }

  .summary,
  .alpha-summary {
    gap: 10px;
    margin-bottom: 12px;
  }

  .summary article,
  .alpha-summary article,
  .venue,
  .signal,
  .opportunity {
    border-radius: 7px;
    padding: 12px;
  }

  .summary strong,
  .alpha-summary strong {
    font-size: 25px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .venue strong {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .venue-title {
    gap: 8px;
    min-height: 0;
  }

  .venue-title h3 {
    font-size: 17px;
  }

  .venue strong,
  .venue-source {
    min-height: 0;
  }

  dl div {
    align-items: baseline;
  }

  dd {
    text-align: right;
    overflow-wrap: anywhere;
  }

  .opportunity-list {
    max-height: none;
  }

  .opportunity h3,
  .signal h3 {
    font-size: 16px;
    line-height: 1.3;
  }

  .opportunity p,
  .signal p {
    font-size: 14px;
    line-height: 1.45;
  }

  .alpha-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .alpha-table-wrap {
    overflow: visible;
  }

  .alpha-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .alpha-table thead {
    display: none;
  }

  .alpha-table tbody,
  .alpha-table tr,
  .alpha-table td {
    display: block;
    width: 100%;
  }

  .alpha-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
  }

  .alpha-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #eef1f5;
    padding: 8px 0;
    text-align: right;
    white-space: normal;
  }

  .alpha-table td:last-child {
    border-bottom: 0;
  }

  .alpha-table td:first-child {
    display: flex;
    align-items: baseline;
  }

  .alpha-table td:first-child small::before {
    content: "/ ";
  }

  .alpha-table td::before {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }

  .alpha-table td:nth-child(1)::before { content: "合约"; }
  .alpha-table td:nth-child(2)::before { content: "Alpha 最新成交价"; }
  .alpha-table td:nth-child(3)::before { content: "合约价"; }
  .alpha-table td:nth-child(4)::before { content: "合约-Alpha价差"; }
  .alpha-table td:nth-child(5)::before { content: "24h"; }
  .alpha-table td:nth-child(6)::before { content: "24h 成交额"; }
  .alpha-table td:nth-child(7)::before { content: "MC"; }
  .alpha-table td:nth-child(8)::before { content: "FDV"; }
  .alpha-table td:nth-child(9)::before { content: "OI 名义"; }
  .alpha-table td:nth-child(10)::before { content: "OI/MC"; }
  .alpha-table td:nth-child(11)::before { content: "当前年化"; }
  .alpha-table td:nth-child(12)::before { content: "7天年化"; }
  .alpha-table td:nth-child(13)::before { content: "标签"; }

  .alpha-table td[colspan] {
    display: block;
    text-align: left;
  }

  .alpha-table td[colspan]::before {
    content: "";
  }

  .funding-positive-hot,
  .funding-negative-hot,
  .spread-hot,
  .spread-watch {
    padding: 4px 7px;
  }

  .tag-row {
    justify-content: flex-end;
    min-width: 0;
  }
}
