
/* DaisyUI integration: final component layer */
html {
  font-size: 16px;
}

body {
  color: #18212f;
  font-family: "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
strong,
button,
label,
th {
  letter-spacing: 0;
}

h1 {
  font-weight: 760;
  line-height: 1.08;
}

h2,
h3 {
  font-weight: 720;
}

.shell {
  width: min(1240px, calc(100% - 36px));
}

.topbar {
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(207, 216, 226, 0.75);
  padding: 4px 0 22px;
}

.topbar > div:first-child {
  min-width: 300px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #397376;
  font-size: 11px;
  font-weight: 800;
}

.topbar h1 {
  margin-bottom: 7px;
  font-size: clamp(30px, 3.5vw, 46px);
}

.topbar p:last-child {
  margin-bottom: 0;
  font-size: 15px;
}

.controls {
  align-items: center;
}

.mode-switch.tabs-box {
  gap: 2px;
  border: 1px solid #d5dee7;
  border-radius: 7px;
  padding: 3px;
  background: rgba(237, 242, 246, 0.92);
}

.mode-switch .tab {
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  padding: 0 13px;
  color: #617083;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-switch .tab:hover:not(:disabled) {
  color: #245f62;
  background: rgba(255, 255, 255, 0.8);
}

.mode-switch .tab.active {
  color: #fff;
  background: #118b8d;
  box-shadow: 0 2px 5px rgba(15, 107, 109, 0.2);
}

.btn {
  min-height: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 80ms ease;
}

.btn.btn-primary {
  border-color: #0f8587;
  color: #fff;
  background: #118b8d;
}

.btn.btn-primary:hover:not(:disabled) {
  border-color: #0b7375;
  color: #fff;
  background: #0d7d7f;
  box-shadow: 0 3px 8px rgba(15, 107, 109, 0.18);
}

.btn.btn-ghost {
  border-color: #cfd9e2;
  color: #536477;
  background: #fff;
}

.btn.btn-ghost:hover:not(:disabled) {
  border-color: #aebdca;
  color: #263548;
  background: #f5f8fa;
}

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

.btn.danger-action:hover:not(:disabled) {
  border-color: #7f1f18;
  background: #8f251e;
}

.btn.grid-delete-button {
  border-color: rgba(242, 85, 121, 0.55);
  color: #ff829d;
  background: rgba(242, 85, 121, 0.1);
}

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

.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.checkbox:focus-visible {
  outline: 3px solid rgba(17, 139, 141, 0.18);
  outline-offset: 2px;
}

.input,
.select {
  width: 100%;
  min-height: 42px;
  height: 42px;
  border: 1px solid #d2dbe5;
  border-radius: 6px;
  color: #202a37;
  background-color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 570;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.025);
}

.input::placeholder {
  color: #98a2b3;
  font-weight: 500;
}

.select {
  padding-right: 34px;
}

.checkbox {
  width: 19px;
  height: 19px;
  border-radius: 4px;
}

.config-panel,
.opportunity-panel,
.section {
  border-color: #d9e1e9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 26px rgba(16, 24, 40, 0.025);
}

.config-panel,
.opportunity-panel {
  padding: 18px;
}

.section {
  padding: 18px;
}

.section-head {
  align-items: center;
  margin-bottom: 16px;
}

.section-head h2 {
  color: #18212f;
  font-size: 20px;
}

.section-head p,
.hint {
  color: #69778a;
  font-weight: 500;
}

.button-row {
  flex-wrap: wrap;
  gap: 8px;
}

/* Stock monitor */
.opportunity-panel > .section-head {
  border-bottom: 1px solid #e6ebf1;
  padding-bottom: 13px;
}

.opportunity-controls {
  grid-template-columns: repeat(3, minmax(130px, 165px)) minmax(260px, 1fr);
  border: 1px solid #e2e9ef;
  border-radius: 7px;
  padding: 12px;
  background: #f8fafb;
}

.opportunity-controls label,
.contract-row label,
.config-grid label,
.compact-field,
.alpha-filters label {
  color: #5f6f82;
  font-size: 12px;
  font-weight: 700;
}

.opportunity {
  border-color: #dde5ec;
  border-left-width: 4px;
  border-radius: 7px;
  padding: 12px 14px;
  box-shadow: none;
}

.opportunity h3 {
  font-size: 16px;
}

.contract-row {
  grid-template-columns: 150px minmax(300px, 1fr) 155px auto minmax(150px, auto);
  border-bottom: 1px solid #e6ebf1;
  padding-bottom: 15px;
}

.stock-config-summary {
  align-items: center;
  margin-top: 14px;
  border-color: #e0e7ee;
  background: #f8fafb;
}

.advanced-stock-config {
  border-top: 1px solid #e8edf2;
  padding-top: 12px;
}

.advanced-stock-config summary {
  width: fit-content;
  color: #3d6870;
  font-weight: 700;
}

.summary {
  gap: 12px;
}

.summary article,
.alpha-summary article {
  border-color: #dbe3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.summary strong,
.alpha-summary strong {
  color: #17212f;
  font-size: 27px;
  font-weight: 740;
}

.hk-leveraged-product-section .section-head > div p {
  margin-top: 5px;
  text-align: left;
}

.hk-product-status {
  border: 1px solid #d6dee7;
  border-radius: 999px;
  padding: 5px 10px;
  color: #526173;
  background: #f6f8fa;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.hk-product-status.tradable {
  border-color: #a9dbc9;
  color: #087a4b;
  background: #ecfdf3;
}

.hk-product-status.watch {
  border-color: #f0cd94;
  color: #93370d;
  background: #fff7ed;
}

.hk-product-status.unavailable {
  border-color: #e8b6b1;
  color: #b42318;
  background: #fff3f2;
}

.hk-leveraged-product-grid,
.hk-leveraged-product-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hk-product-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid #dce4eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.hk-product-card span,
.hk-product-card small,
.hk-leveraged-product-details span {
  color: var(--muted);
  font-size: 12px;
}

.hk-product-card strong {
  overflow-wrap: anywhere;
  color: #17212f;
  font-size: 22px;
  font-weight: 740;
}

.hk-product-card.unavailable {
  grid-column: 1 / -1;
}

.hk-product-card .premium-positive {
  color: #b42318;
  font-weight: 760;
}

.hk-product-card .premium-negative {
  color: #087a4b;
  font-weight: 760;
}

.hk-binance-comparison {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #cfe0e3;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbfb 0%, #fff 75%);
}

.hk-binance-comparison-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hk-binance-comparison-head > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid #e0eaec;
}

.hk-binance-comparison-head > div:last-child {
  border-right: 0;
}

.hk-binance-comparison-head span,
.hk-binance-comparison-head small,
.hk-binance-decision small,
.hk-binance-unavailable span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hk-binance-comparison-head strong {
  overflow-wrap: anywhere;
  color: #17212f;
  font-size: 20px;
  font-weight: 760;
}

.hk-binance-comparison-head .gap-rich {
  color: #b42318;
}

.hk-binance-comparison-head .gap-cheap {
  color: #087a4b;
}

.hk-binance-decision {
  display: grid;
  grid-template-columns: auto minmax(180px, max-content) 1fr;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #dce8ea;
  padding: 11px 16px;
  background: rgba(238, 247, 247, 0.7);
}

.hk-binance-decision.opportunity {
  background: #fff8ed;
}

.hk-binance-decision strong {
  color: #243442;
  font-size: 13px;
}

.hk-binance-state {
  border: 1px solid #d6dee7;
  border-radius: 999px;
  padding: 4px 9px;
  color: #526173;
  background: #fff;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.hk-binance-state.tradable {
  border-color: #a9dbc9;
  color: #087a4b;
  background: #ecfdf3;
}

.hk-binance-state.watch {
  border-color: #f0cd94;
  color: #93370d;
  background: #fff7ed;
}

.hk-binance-unavailable {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
}

.hk-binance-unavailable strong {
  color: #526173;
  font-size: 13px;
}

.hk-leveraged-product-details {
  margin-top: 10px;
}

.hk-leveraged-product-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid #e7edf2;
  padding: 9px 3px 0;
}

.hk-leveraged-product-details strong {
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 13px;
}

.hk-leveraged-product-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .hk-leveraged-product-grid,
  .hk-leveraged-product-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hk-binance-comparison-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hk-binance-comparison-head > div:nth-child(2) {
    border-right: 0;
  }

  .hk-binance-comparison-head > div:nth-child(-n + 2) {
    border-bottom: 1px solid #e0eaec;
  }

  .hk-binance-decision {
    grid-template-columns: auto 1fr;
  }

  .hk-binance-decision small {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .hk-leveraged-product-grid,
  .hk-leveraged-product-details,
  .hk-binance-comparison-head {
    grid-template-columns: 1fr;
  }

  .hk-binance-comparison-head > div {
    border-right: 0;
    border-bottom: 1px solid #e0eaec;
  }

  .hk-binance-comparison-head > div:last-child {
    border-bottom: 0;
  }

  .hk-binance-decision {
    grid-template-columns: 1fr;
  }

  .hk-binance-decision small {
    grid-column: auto;
  }
}

.venue-grid {
  gap: 12px;
}

.venue {
  border-color: #dce4eb;
  border-radius: 8px;
  padding: 15px;
  box-shadow: none;
}

.venue-title {
  border-bottom: 1px solid #e9edf2;
  padding-bottom: 10px;
}

.venue > strong {
  margin: 10px 0 2px;
  font-size: 27px;
  font-weight: 740;
}

.venue dl div {
  min-height: 37px;
}

/* Notification rules */
.notification-panel {
  display: grid;
  gap: 14px;
}

.notification-panel > .section-head {
  margin-bottom: 0;
  border-bottom: 1px solid #e4eaf0;
  padding-bottom: 14px;
}

.notification-block {
  border: 1px solid #dfe7ee;
  border-radius: 7px;
  padding: 13px;
  background: #f8fafb;
}

.notification-card {
  margin-top: 0;
  border-color: #dde5ec;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}

.notification-card > .check-field,
.notification-card-head {
  min-height: 34px;
  margin-bottom: 10px;
  border-bottom: 1px solid #edf1f4;
  padding-bottom: 10px;
}

.check-field,
.notification-block > .check-field,
.notification-card .check-field,
.notification-card-head > .check-field {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 9px;
  width: auto;
  min-width: 0;
  color: #253141;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.check-field > input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
}

.check-field > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-target-form {
  gap: 10px;
}

.us-stock-notification-card .notification-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-inline-status {
  flex: 0 0 auto;
  border: 1px solid #cfdbe5;
  border-radius: 999px;
  padding: 5px 10px;
  color: #607286;
  background: #f7fafc;
  font-size: 12px;
  font-weight: 700;
}

.notification-inline-status.ready {
  border-color: #9bd9d2;
  color: #087b76;
  background: #effaf8;
}

.us-stock-notification-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.us-stock-notification-profile-grid > article {
  min-width: 0;
  border: 1px solid #e2e9ef;
  border-radius: 7px;
  padding: 12px;
  background: #fafcfd;
}

.us-stock-notification-profile-grid > article > .check-field {
  margin-bottom: 10px;
}

.us-stock-notification-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.us-stock-notification-fields label {
  color: #5f6f82;
  font-size: 12px;
  font-weight: 700;
}

.us-stock-data-alert-field {
  margin-top: 12px;
}

.notification-target-form label,
.notification-block label:not(.check-field) {
  color: #5f6f82;
  font-size: 12px;
  font-weight: 700;
}

.notification-target-list {
  margin-top: 12px;
  border-top: 1px dashed #dce4eb;
  padding-top: 12px;
}

.notification-target {
  border-color: #dde5ec;
  border-radius: 7px;
  padding: 12px;
  background: #fafcfd;
}

.notification-target > .btn,
.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] {
  border-color: #9b2c21;
  color: #fff;
  background: #9b2c21;
  box-shadow: none;
}

/* Alpha radar */
.alpha-head {
  border-bottom: 1px solid #e6ebf1;
  padding-bottom: 13px;
}

.alpha-filters {
  gap: 9px;
}

.alpha-table-wrap {
  border: 1px solid #e1e7ed;
  border-radius: 7px;
  background: #fff;
}

.alpha-table {
  font-size: 13px;
}

.alpha-table th {
  height: 44px;
  color: #607084;
  background: #f6f8fa;
  font-size: 11px;
  font-weight: 760;
  text-transform: none;
}

.alpha-table td {
  height: 52px;
  border-color: #e9edf2;
}

.alpha-table.table-zebra tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.tag,
.badge {
  min-height: 24px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.tag.interval-tag {
  border-color: #c5d8e7;
  color: #315d7a;
  background: #eef6fb;
}

/* Trading */
.trading-panel > .section-head {
  border-bottom: 1px solid #e5ebf0;
  padding-bottom: 14px;
}

.trading-warning {
  border: 1px solid #f2d39f;
  border-left: 4px solid #d99026;
  border-radius: 7px;
  color: #7a4a10;
  background: #fff9ed;
}

.trading-card,
.trading-live-card,
.trade-leg,
.trading-order {
  border-color: #dce4eb;
  border-radius: 8px;
  background: #fff;
}

.trading-card-head {
  border-bottom: 1px solid #e8edf2;
  padding-bottom: 11px;
}

.trading-live-card h3 {
  font-weight: 760;
}

.trading-live-log {
  border: 1px solid #263442;
  border-radius: 7px;
  background: #111a24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Chip analysis */
.chip-query-panel {
  max-width: none;
}

.chip-query-form {
  grid-template-columns: minmax(0, 720px) 130px;
}

.chip-search-menu {
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
}

.chip-search-option {
  font-family: inherit;
  font-size: 13px;
}

.chip-search-option strong {
  font-weight: 740;
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .mode-switch {
    flex: 1;
  }

  .mode-switch .tab {
    flex: 1;
  }

  .contract-row,
  .opportunity-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .shell {
    width: 100%;
    padding: 16px 10px 30px;
  }

  .topbar {
    padding-bottom: 16px;
  }

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

  .topbar h1 {
    font-size: 29px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch.tabs-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-switch .tab {
    width: 100%;
    padding: 0 7px;
    font-size: 13px;
  }

  .btn,
  .input,
  .select {
    min-height: 44px;
    height: 44px;
  }

  .config-panel,
  .opportunity-panel,
  .section {
    padding: 12px;
  }

  .section-head {
    align-items: stretch;
  }

  .section-head p {
    text-align: left;
  }

  .button-row .btn {
    flex: 1;
  }

  .notification-block > .check-field {
    align-self: start;
    min-height: 44px;
  }

  .contract-row,
  .opportunity-controls,
  .notification-block,
  .notification-target-form,
  .us-stock-notification-profile-grid,
  .us-stock-notification-fields,
  .stock-target-form,
  .funding-target-form,
  .price-target-form,
  .alpha-spread-target-form,
  .alpha-index-target-form,
  .trading-form,
  .trading-strategy-grid,
  .trading-strategy-grid.risk-grid,
  .trading-grid-summary,
  .grid-instance-stats,
  .chip-query-form {
    grid-template-columns: 1fr;
  }

  .trading-grid-create-row,
  .grid-initial-order {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-config-summary {
    align-items: flex-start;
  }

  .summary,
  .alpha-summary,
  .chip-summary {
    grid-template-columns: 1fr 1fr;
  }

  .chip-holder-table td:nth-child(1)::before { content: "排名"; }
  .chip-holder-table td:nth-child(2)::before { content: "地址"; }
  .chip-holder-table td:nth-child(3)::before { content: "类型"; }
  .chip-holder-table td:nth-child(4)::before { content: "持仓数量"; }
  .chip-holder-table td:nth-child(5)::before { content: "供应量占比"; }

  .chip-holder-table td:nth-child(n+6)::before {
    content: "";
  }

  .chip-holder-table .chip-address-cell {
    justify-items: end;
  }
}

/* Stable header geometry across module switches */
@media (min-width: 1101px) {
  .topbar {
    min-height: 168px;
    align-items: start;
    box-sizing: border-box;
  }

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

  .topbar h1 {
    min-height: 50px;
  }

  #subtitle {
    min-height: 44px;
    max-width: 720px;
  }

  .topbar .controls {
    align-self: start;
    padding-top: 27px;
  }
}

.alpha-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#alphaTopPositiveFunding {
  color: #b42318;
}

#alphaTopNegativeFunding {
  color: #087a4b;
}

@media (max-width: 1100px) {
  .alpha-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .alpha-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .alpha-summary {
    grid-template-columns: 1fr;
  }
}

/* Opportunity settings: summary first, editor on demand */
.opportunity-threshold-display {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 190px)) minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  padding: 11px 13px;
  background: #f8fafb;
}

.opportunity-threshold-display > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-right: 1px solid #e1e8ee;
  padding: 8px 13px 8px 2px;
}

.opportunity-threshold-display span {
  color: #66758a;
  font-size: 12px;
  font-weight: 680;
}

.opportunity-threshold-display strong {
  color: #182434;
  font-size: 19px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.opportunity-threshold-display small {
  justify-self: end;
  color: #477277;
  font-size: 12px;
  font-weight: 650;
}

.opportunity-controls[hidden] {
  display: none !important;
}

.opportunity-controls:not([hidden]) {
  margin-bottom: 14px;
  animation: settings-reveal 140ms ease-out;
}

@keyframes settings-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn.secondary-action {
  border-color: #b8c7d2;
  color: #405468;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn.secondary-action:hover:not(:disabled),
.btn.secondary-action.settings-open {
  border-color: #6c999d;
  color: #185d61;
  background: #edf8f7;
}

/* Custom select surfaces */
button.contract-combobox-trigger:hover:not(:disabled),
button.contract-combobox-trigger[aria-expanded="true"] {
  color: #1e2938;
  background: #fff;
}

button.contract-option:hover:not(:disabled),
button.contract-option.selected {
  color: #174f52;
  background: #edf8f7;
}

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

.simple-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 44px;
  border: 1px solid #ccd7e1;
  border-radius: 7px;
  padding: 0 13px;
  color: #1e2938;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

button.simple-combobox-trigger:hover:not(:disabled),
button.simple-combobox-trigger[aria-expanded="true"] {
  border-color: #168f91;
  color: #1e2938;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.12);
}

.simple-combobox-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(225deg);
}

.simple-combobox-menu {
  position: absolute;
  z-index: 82;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  min-width: 170px;
  border: 1px solid #ccd7e1;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 35, 50, 0.16), 0 3px 9px rgba(20, 35, 50, 0.08);
}

.simple-combobox-menu[hidden] {
  display: none !important;
}

.simple-combobox-menu button {
  position: relative;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px 8px 34px;
  color: #263446;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}

.simple-combobox-menu button:hover:not(:disabled),
.simple-combobox-menu button.selected {
  color: #185d61;
  background: #edf8f7;
}

.simple-combobox-menu button.selected::before {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #118b8d;
  border-left: 2px solid #118b8d;
  content: "";
  transform: translateY(-65%) rotate(-45deg);
}

@media (max-width: 760px) {
  .opportunity-threshold-display {
    grid-template-columns: 1fr;
  }

  .opportunity-threshold-display > div {
    border-right: 0;
    border-bottom: 1px solid #e1e8ee;
    padding-right: 2px;
  }

  .opportunity-threshold-display small {
    justify-self: start;
  }
}

/* Alpha filter custom selects */
.alpha-filters label:nth-child(1),
.alpha-filters label:nth-child(2),
.alpha-filters label:nth-child(3) {
  width: 132px;
}

.alpha-filters label:nth-child(4) {
  width: 224px;
}

.styled-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.styled-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 42px;
  border: 1px solid #ccd7e1;
  border-radius: 7px;
  padding: 0 12px;
  color: #1e2938;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

button.styled-select-trigger:hover:not(:disabled),
button.styled-select-trigger[aria-expanded="true"] {
  border-color: #168f91;
  color: #1e2938;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.12);
}

.styled-select-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.styled-select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(225deg);
}

.styled-select-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(310px, calc(100vw - 28px));
  border: 1px solid #ccd7e1;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 35, 50, 0.16), 0 3px 9px rgba(20, 35, 50, 0.08);
}

.styled-select-menu[hidden] {
  display: none !important;
}

.styled-select-menu button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 13px 8px 34px;
  color: #263446;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.styled-select-menu button:hover:not(:disabled),
.styled-select-menu button.selected {
  color: #185d61;
  background: #edf8f7;
}

.styled-select-menu button.selected::before {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #118b8d;
  border-left: 2px solid #118b8d;
  content: "";
  transform: translateY(-65%) rotate(-45deg);
}

.styled-select-group {
  padding: 8px 11px 5px;
  color: #78879a;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

/* Notification settings refinement */
.notification-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.notification-category-tabs button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-width: 0;
  min-height: 72px;
  border: 1px solid #d9e3eb;
  padding: 12px 14px;
  color: #344257;
  text-align: left;
  background: #f7f9fb;
  box-shadow: none;
}

.notification-category-tabs button:hover:not(:disabled) {
  border-color: #8dc7c7;
  background: #f2f9f9;
}

.notification-category-tabs button.active {
  border-color: #118b8d;
  color: #0b7375;
  background: #eef9f9;
  box-shadow: inset 0 -3px 0 #118b8d;
}

.notification-category-tabs strong,
.notification-category-tabs small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-category-tabs strong {
  font-size: 15px;
  font-weight: 800;
}

.notification-category-tabs small {
  color: #6b7a8e;
  font-size: 12px;
  font-weight: 650;
}

.notification-category-tabs button:not(.active) small {
  color: #fff;
  opacity: 1;
}

.notification-category-tabs button.active small {
  color: #5f7085;
}

.notification-category-panels {
  min-width: 0;
}

.notification-category-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #dfe7ee;
  border-radius: 9px;
  padding: 15px;
  background: #f8fafb;
}

.notification-category-panel[hidden] {
  display: none !important;
}

.notification-category-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e2e9ef;
  padding-bottom: 12px;
}

.notification-category-head .eyebrow,
.notification-category-head h3,
.notification-category-head > p {
  margin: 0;
}

.notification-category-head h3 {
  color: #1f2b3a;
  font-size: 20px;
}

.notification-category-head > p {
  max-width: 720px;
  color: #65758a;
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.notification-category-head-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.notification-category-head-action p {
  max-width: 620px;
  margin: 0;
  color: #65758a;
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.notification-category-head-action button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  font-size: 13px;
}

.us-stock-notification-card {
  scroll-margin-top: 18px;
}

.us-stock-notification-card.focus-flash {
  animation: us-stock-notification-focus 1.4s ease-out;
}

@keyframes us-stock-notification-focus {
  0%, 35% {
    border-color: #0f9290;
    box-shadow: 0 0 0 4px rgba(15, 146, 144, 0.18);
  }
  100% {
    border-color: #dde5ec;
    box-shadow: none;
  }
}

.notification-settings-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 260px 220px;
  gap: 10px;
}

.notification-settings-summary article {
  min-width: 0;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafb;
}

.notification-settings-summary span {
  display: block;
  margin-bottom: 5px;
  color: #66768a;
  font-size: 12px;
  font-weight: 760;
}

.notification-settings-summary strong {
  display: block;
  overflow: hidden;
  color: #1e2938;
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-settings-summary article.enabled strong {
  color: #087f5b;
}

.notification-settings-summary article.disabled strong {
  color: #8a3a2f;
}

.notification-block[hidden] {
  display: none !important;
}

.notification-panel .button-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-panel .button-row button {
  min-width: 92px;
}

.notification-panel .check-field {
  gap: 10px !important;
}

.notification-panel .check-field > input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 19px;
  min-width: 19px;
  height: 19px;
  min-height: 19px;
  border: 1.5px solid #b8c6d3;
  border-radius: 5px;
  padding: 0;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.05);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.notification-panel .check-field > input[type="checkbox"]:checked {
  border-color: #118b8d;
  background-color: #118b8d;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.15L5.65 9.8L11.1 4.2' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.12);
}

.notification-panel .check-field > input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.2);
}

.notification-panel .check-field > span {
  color: #223044;
  font-size: 15px;
  font-weight: 760;
}

.notification-panel .styled-select {
  width: 100%;
}

.notification-panel .styled-select-trigger {
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.notification-panel .styled-select-menu {
  left: 0;
  right: auto;
  width: 100%;
  min-width: 100%;
  max-width: min(560px, calc(100vw - 36px));
  max-height: 360px;
  overflow: auto;
}

.notification-target-fields .styled-select-menu {
  max-width: 260px;
}

.notification-panel .styled-select-menu button {
  white-space: normal;
}

.notification-target-form .native-select-proxy,
.notification-target .native-select-proxy {
  width: 1px !important;
  height: 1px !important;
}

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

@media (max-width: 1180px) {
  .notification-category-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-settings-summary {
    grid-template-columns: 1fr;
  }

  .notification-webhook-field {
    grid-column: auto;
  }

  .notification-target.price-target {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .notification-category-tabs button {
    min-height: 58px;
    padding: 10px;
  }

  .notification-category-tabs small {
    display: none;
  }

  .notification-category-panel {
    padding: 12px;
  }

  .notification-category-head {
    display: grid;
    align-items: start;
  }

  .notification-category-head > p {
    text-align: left;
  }

  .notification-category-head-action {
    display: grid;
    justify-content: stretch;
  }

  .notification-category-head-action p {
    text-align: left;
  }

  .notification-panel > .section-head {
    align-items: stretch;
  }

  .notification-panel .button-row {
    justify-content: stretch;
  }

  .notification-panel .button-row button {
    flex: 1 1 120px;
  }

  .notification-panel .styled-select-menu {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .alpha-filters label:nth-child(1),
  .alpha-filters label:nth-child(2),
  .alpha-filters label:nth-child(3),
  .alpha-filters label:nth-child(4) {
    width: 100%;
  }

  .styled-select-menu {
    right: auto;
    left: 0;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .summary,
  .alpha-summary,
  .chip-summary,
  .chip-analysis-grid,
  .chip-dex-list {
    grid-template-columns: 1fr;
  }

  .mode-switch.tabs-box {
    grid-template-columns: 1fr 1fr;
  }

  .notification-target,
  .notification-target.single-threshold-target,
  .notification-target.threshold-target,
  .notification-target.index-target {
    grid-template-columns: 1fr;
  }

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

/* Global control refinement */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.controls {
  flex-wrap: nowrap;
}

.mode-switch.tabs-box {
  display: inline-flex;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  border-radius: 9px;
  padding: 4px;
  background: #edf2f5;
  box-shadow: inset 0 0 0 1px rgba(35, 55, 72, 0.03);
}

.mode-switch .tab {
  position: relative;
  min-width: max-content;
  height: 40px;
  min-height: 40px;
  border-radius: 6px;
  padding-inline: 15px;
  font-size: 13px;
  font-weight: 720;
}

.mode-switch .tab.active {
  box-shadow: 0 1px 2px rgba(15, 80, 82, 0.18), 0 4px 12px rgba(15, 107, 109, 0.12);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.input,
.select,
input:not([type="checkbox"]):not([type="radio"]),
select {
  border-color: #ccd7e1;
  border-radius: 7px;
  color: #1e2938;
  background-color: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.3;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.input:hover,
.select:hover,
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover {
  border-color: #9fb1bf;
}

.input:focus,
.select:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  border-color: #168f91;
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.13);
}

select,
.select {
  cursor: pointer;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #657487 50%),
    linear-gradient(135deg, #657487 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 50%,
    calc(100% - 13px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  font-weight: 650;
}

select option,
select optgroup {
  color: #243142;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
}

select optgroup {
  color: #758294;
  font-weight: 700;
}

.native-select-proxy {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

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

.contract-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 44px;
  border: 1px solid #ccd7e1;
  border-radius: 7px;
  padding: 0 13px;
  color: #1e2938;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 680;
  text-align: left;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.contract-combobox-trigger:hover,
.contract-combobox-trigger[aria-expanded="true"] {
  border-color: #168f91;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.12);
}

.contract-combobox-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid #637286;
  border-bottom: 2px solid #637286;
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.contract-combobox-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(225deg);
}

.contract-combobox-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  width: min(620px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid #ccd7e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 35, 50, 0.18), 0 4px 12px rgba(20, 35, 50, 0.08);
}

.contract-combobox-search {
  border-bottom: 1px solid #e5ebf0;
  padding: 10px;
  background: #f7f9fb;
}

.contract-combobox-search .input,
.contract-combobox-search input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  background: #fff;
}

.contract-combobox-options {
  max-height: min(460px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: #b8c5d0 transparent;
}

.contract-option-group {
  position: sticky;
  z-index: 1;
  top: -6px;
  padding: 9px 10px 6px;
  color: #758396;
  background: rgba(255, 255, 255, 0.96);
  font-size: 11px;
  font-weight: 760;
}

.contract-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: #1e2938;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.contract-option:hover,
.contract-option.selected {
  color: #174f52;
  background: #edf8f7;
}

.contract-option.selected {
  box-shadow: inset 3px 0 0 #118b8d;
}

.contract-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.contract-option strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-option small {
  overflow: hidden;
  color: #738195;
  font-size: 12px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-option .contract-option-meta {
  justify-items: end;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contract-option-empty {
  margin: 0;
  padding: 28px 16px;
  color: #788699;
  text-align: center;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .mode-switch.tabs-box {
    width: 100%;
  }

  .mode-switch .tab {
    flex: 1 1 0;
  }
}

@media (max-width: 760px) {
  .mode-switch.tabs-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .mode-switch .tab {
    min-width: 0;
    padding-inline: 8px;
  }

  .contract-combobox-menu {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 72vh;
  }

  .contract-combobox-options {
    max-height: calc(72vh - 62px);
  }
}

.alpha-modal-head .icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid #d8e2e8;
  border-radius: 50%;
  padding: 0;
  color: #64748b;
  background: rgba(248, 250, 252, .9);
  box-shadow: none;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}

.alpha-modal-head .icon-button:hover:not(:disabled) {
  border-color: rgba(17, 139, 141, .32);
  color: #0f7779;
  background: rgba(17, 139, 141, .1);
  box-shadow: 0 2px 8px rgba(15, 107, 109, .12);
  transform: none;
}

.alpha-modal-head .icon-button:focus-visible {
  border-color: #118b8d;
  outline: 3px solid rgba(17, 139, 141, .16);
  outline-offset: 2px;
}
.forex-overview-panel {
  padding: 20px;
}

.forex-head {
  align-items: flex-end;
}

.forex-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.forex-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.forex-state-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid #edf1f4;
}

.forex-state-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.forex-status {
  flex: 0 0 auto;
  border: 1px solid #c9d7d8;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: #eef8f8;
  font-size: 12px;
  font-weight: 850;
}

.forex-status.delayed {
  border-color: #a6d4d5;
  color: #087174;
  background: #e8f6f6;
}

.forex-status.stale {
  border-color: #f5c98b;
  color: #92400e;
  background: #fff7e8;
}

.forex-status.unavailable {
  border-color: #f2b8b5;
  color: var(--red);
  background: #fff1f0;
}

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

.forex-summary article {
  min-width: 0;
  border: 1px solid #e6ecef;
  border-radius: 9px;
  padding: 15px;
  background: linear-gradient(145deg, #fbfdfd, #f6fafb);
}

.forex-summary span,
.forex-summary small {
  display: block;
  color: var(--muted);
}

.forex-summary span {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 750;
}

.forex-summary strong {
  display: block;
  margin-bottom: 7px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
}

.forex-summary small {
  min-height: 34px;
  font-size: 12px;
  line-height: 1.45;
}

.forex-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4eaee;
  border-radius: 9px;
}

.forex-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.forex-table th,
.forex-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1f4;
  text-align: right;
  white-space: nowrap;
}

.forex-table th {
  color: var(--muted);
  background: #f7fafb;
  font-size: 12px;
  font-weight: 800;
}

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

.forex-table tbody tr:last-child td {
  border-bottom: 0;
}

.forex-table tbody tr.forex-contract-alert {
  background: #fffbf5;
}

.forex-table td strong,
.forex-table td small {
  display: block;
}

.forex-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.forex-alert-value {
  color: var(--amber);
}

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

.forex-signal {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(320px, 1.3fr);
  gap: 16px;
  align-items: center;
  border: 1px solid #e5eaee;
  border-left: 4px solid #8ca1a3;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfcfd;
}

.forex-signal.high {
  border-left-color: var(--red);
  background: #fff8f7;
}

.forex-signal.medium {
  border-left-color: var(--amber);
  background: #fffbf4;
}

.forex-signal.low {
  border-left-color: var(--green);
  background: #f5fbf8;
}

.forex-signal span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.forex-signal h3,
.forex-signal p {
  margin: 0;
}

.forex-signal h3 {
  margin-top: 4px;
  font-size: 15px;
}

.forex-signal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.forex-disclaimer {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .forex-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forex-signal {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .forex-head,
  .forex-toolbar,
  .forex-state-row {
    align-items: stretch;
  }

  .forex-toolbar,
  .forex-state-row {
    flex-direction: column;
  }

  .forex-toolbar label {
    min-width: 0;
  }

  .forex-summary {
    grid-template-columns: 1fr;
  }
}

.account-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.account-control span {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-control .btn {
  min-height: 32px;
  height: 32px;
  padding-inline: 12px;
}

.auth-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid #cdddf8;
  border-radius: 22px;
  background: linear-gradient(135deg, #f7faff, #eef4ff);
  box-shadow: var(--shadow);
}

.auth-gate h2,
.auth-gate p {
  margin: 0;
}

.auth-gate h2 {
  margin: 5px 0 8px;
}

.auth-gate p:not(.eyebrow) {
  color: var(--muted);
}

.auth-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(7px);
}

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

.auth-card form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-card form > label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #9f1d1d;
  background: #fff0f0;
  font-size: 13px;
}

@media (max-width: 900px) {
  .account-control {
    order: 2;
  }

  .auth-gate {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .grid-direction-columns,
  .grid-trigger-preview,
  .binance-position-list {
    grid-template-columns: 1fr;
  }

  .trading-execution-batch-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .grid-direction-scroll {
    max-height: min(44vh, 420px);
  }
}

@media (max-width: 640px) {
  .grid-trigger-preview-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-current-level {
    grid-template-columns: 1fr;
  }

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

  .binance-position-metrics {
    grid-template-columns: 1fr;
  }

  .trading-execution-batch-metrics {
    justify-content: flex-start;
  }

  .grid-execution-status {
    grid-template-columns: 1fr;
  }
}

/* Trading controls and confirmation dialog */
.trading-warning.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(134, 83, 15, 0.06);
}

.trading-warning-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #d99026;
  font-size: 15px;
  font-weight: 900;
}

.trading-warning strong,
.trading-warning p {
  margin: 0;
}

.trading-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #75430b;
  font-size: 14px;
}

.trading-warning p {
  font-size: 13px;
  font-weight: 680;
  line-height: 1.65;
}

.trading-form {
  grid-template-columns: minmax(240px, 320px);
}

.trading-form.trading-global-controls {
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  align-items: start;
}

.trading-enabled-control {
  min-height: 50px;
  padding: 6px 0;
}

.check-field .qiqi-switch,
.trading-enabled-control input.qiqi-switch {
  display: inline-block;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  flex: 0 0 48px;
  appearance: none;
  padding: 0;
  border: 1px solid #b9c6d3;
  border-radius: 999px;
  background: radial-gradient(circle at 13px 50%, #fff 0 9px, transparent 10px), #cbd5df;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
  color: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.check-field .qiqi-switch:checked,
.trading-enabled-control input.qiqi-switch:checked {
  border-color: #118b8d;
  background: radial-gradient(circle at 34px 50%, #fff 0 9px, transparent 10px), #15999a;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.11);
}

.trading-enabled-copy {
  display: grid;
  gap: 2px;
}

.trading-enabled-copy strong {
  color: #1d2939;
  font-size: 14px;
}

.trading-enabled-copy small {
  color: #78879a;
  font-size: 11px;
  font-weight: 650;
}

.trading-liquidation-alert-control {
  display: grid;
  gap: 4px;
}

.trading-liquidation-alert-control .trading-enabled-control {
  padding-bottom: 0;
}

.trading-panel button.trading-liquidation-threshold-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  min-height: 32px;
  margin-left: 60px;
  border: 1px solid #cfe4e2;
  border-radius: 999px;
  padding: 5px 11px;
  color: #5f7284;
  background: #f3faf9;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

.trading-panel button.trading-liquidation-threshold-summary:hover:not(:disabled),
.trading-panel button.trading-liquidation-threshold-summary:focus-visible {
  border-color: #80b9b7;
  color: #087f7b;
  background: #e8f6f4;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.09);
}

.trading-liquidation-threshold-summary strong {
  color: #087f7b;
  font-size: 13px;
}

.trading-liquidation-threshold-summary small {
  color: #9aa7b6;
}

.trading-liquidation-dialog-field {
  display: grid;
  gap: 9px;
  margin-top: 17px;
  border: 1px solid #dce7ec;
  border-radius: 14px;
  padding: 15px;
  color: #344256;
  background: #f8fbfb;
  font-size: 13px;
  font-weight: 760;
}

.trading-liquidation-dialog-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trading-liquidation-dialog-input input {
  width: 150px;
  font-size: 20px;
  font-weight: 800;
}

.trading-liquidation-dialog-input strong {
  color: #087f7b;
  font-size: 18px;
}

.trading-liquidation-dialog-field small {
  color: #78879a;
  font-size: 11px;
  line-height: 1.55;
}

.adr-grid-config-card {
  overflow: visible;
  border-color: #d8e6e6;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  box-shadow: 0 12px 30px rgba(22, 72, 76, 0.05);
}

.adr-grid-config-card .trading-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.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;
}

.adr-grid-config-card.collapsed .trading-card-head {
  margin-bottom: 0;
}

.grid-config-toggle {
  flex: 0 0 auto;
  min-width: 112px;
}

.adr-grid-config-body[hidden] {
  display: none;
}

.grid-formula-hint {
  border: 1px solid #dbe7e9;
  border-radius: 10px;
  padding: 11px 13px;
  color: #58697d;
  background: #f7fafb;
  line-height: 1.65;
}

.grid-parameter-group {
  margin-top: 12px;
  border: 1px solid #e0e8ee;
  border-radius: 12px;
  padding: 14px 15px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.grid-parameter-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-parameter-heading > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: #087f7b;
  background: #e9f7f6;
  font-size: 11px;
  font-weight: 850;
}

.grid-parameter-heading div {
  display: grid;
  gap: 1px;
}

.grid-parameter-heading strong {
  color: #243142;
  font-size: 14px;
}

.grid-parameter-heading small {
  color: #8190a3;
  font-size: 11px;
  font-weight: 620;
}

.adr-grid-config-card .trading-strategy-grid.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
  justify-content: start;
  align-items: start;
  gap: 12px 14px;
  margin-top: 13px;
}

.adr-grid-config-card .compact-grid > label,
.adr-grid-config-card .compact-grid input:not([type="checkbox"]),
.adr-grid-config-card .compact-grid .styled-select,
.adr-grid-config-card .compact-grid .grid-count-preview {
  width: 100%;
  max-width: 220px;
}

.adr-grid-config-card .compact-grid input:not([type="checkbox"]),
.adr-grid-config-card .compact-grid .styled-select-trigger {
  height: 42px;
  border-radius: 10px;
}

.adr-grid-config-card .grid-count-preview {
  border-radius: 10px;
  font-size: 14px;
}

.styled-select-trigger {
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.styled-select-trigger:focus-visible {
  outline: 2px solid rgba(17, 139, 141, 0.34);
  outline-offset: 2px;
}

.styled-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.styled-select-menu {
  overflow: auto;
  max-height: min(340px, 52vh);
  border-radius: 11px;
}

.qiqi-confirm-modal {
  position: fixed;
  z-index: 2500;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 20px;
  color: #223044;
  background: transparent;
  overflow: hidden;
}

.qiqi-confirm-modal[open] {
  display: grid;
  place-items: center;
}

.qiqi-confirm-modal::backdrop {
  background: transparent;
}

.qiqi-confirm-box {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  overflow: visible;
  border: 1px solid #dce5ec;
  border-radius: 20px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.26);
}

.qiqi-confirm-modal > .qiqi-confirm-screen {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.qiqi-confirm-modal > .qiqi-confirm-screen button {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  font-size: 0;
  cursor: default;
}

.qiqi-confirm-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.qiqi-confirm-heading h3,
.qiqi-confirm-heading p {
  margin: 0;
}

.qiqi-confirm-heading h3 {
  margin-top: 3px;
  color: #172033;
  font-size: 21px;
  line-height: 1.25;
}

.qiqi-confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 14px;
  color: #087f7b;
  background: #e7f7f5;
  font-size: 21px;
  font-weight: 900;
}

.qiqi-confirm-modal[data-severity="warning"] .qiqi-confirm-icon {
  color: #9a5d0a;
  background: #fff2d8;
}

.qiqi-confirm-modal[data-severity="danger"] .qiqi-confirm-icon {
  color: #b42318;
  background: #ffebe8;
}

.qiqi-confirm-message {
  margin: 17px 0 0;
  color: #58697d;
  font-size: 14px;
  line-height: 1.65;
}

.qiqi-confirm-details {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  border: 1px solid #e2e9ef;
  border-radius: 12px;
  padding: 12px 14px 12px 32px;
  color: #344256;
  background: #f8fafb;
  font-size: 13px;
  font-weight: 650;
}

.qiqi-confirm-details[hidden] {
  display: none;
}

.qiqi-confirm-input {
  display: grid;
  gap: 6px;
  margin-top: 15px;
  color: #344256;
  font-size: 13px;
  font-weight: 760;
}

.qiqi-confirm-input[hidden] {
  display: none;
}

.qiqi-confirm-input input {
  width: min(280px, 100%);
}

.qiqi-confirm-input small {
  color: #8a4b08;
  font-weight: 650;
}

.qiqi-confirm-error {
  margin: 10px 0 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 750;
}

.qiqi-confirm-box .modal-action {
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 760px) {
  .trading-form,
  .adr-grid-config-card .trading-strategy-grid.compact-grid {
    grid-template-columns: 1fr;
  }

  .adr-grid-config-card .compact-grid > label,
  .adr-grid-config-card .compact-grid input:not([type="checkbox"]),
  .adr-grid-config-card .compact-grid .styled-select,
  .adr-grid-config-card .compact-grid .grid-count-preview {
    max-width: none;
  }

  .trading-grid-create-row {
    align-items: stretch;
    flex-direction: column;
  }

  .adr-grid-config-card .trading-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-config-toggle {
    width: 100%;
  }

  .qiqi-confirm-box {
    border-radius: 16px;
    padding: 20px;
  }
}

/* Shared checkbox treatment for every standard check-field control. */
.check-field > input[type="checkbox"]:not(.qiqi-switch) {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 21px;
  min-width: 21px;
  max-width: 21px;
  height: 21px;
  min-height: 21px;
  max-height: 21px;
  flex: 0 0 21px;
  margin: 0;
  border: 1.5px solid #b5c3d1;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.check-field > input[type="checkbox"]:not(.qiqi-switch):hover:not(:disabled) {
  border-color: #5ba8a5;
}

.check-field > input[type="checkbox"]:not(.qiqi-switch):checked {
  border-color: #118b8d;
  background-color: #118b8d;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.15L5.65 9.8L11.1 4.2' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.12);
}

.check-field > input[type="checkbox"]:not(.qiqi-switch):focus-visible {
  border-color: #118b8d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 139, 141, 0.2);
}

.check-field > input[type="checkbox"]:not(.qiqi-switch):disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.check-field:has(> input[type="checkbox"]:not(.qiqi-switch):not(:disabled)) {
  cursor: pointer;
}

.trading-v2-fee-spread-toggle {
  min-height: 44px;
}

/* The trading strategy tabs attach directly to the header divider. */
#tradingMode:not([hidden]) {
  margin-top: -24px;
}
