/* DPX v0.8.1 - M8 fixed-scope UI patch.
   Loaded last so the one-minute setup, larger labels and full-page Chrome
   scrolling override the legacy six-horizon compact rules without touching
   unrelated trading screens. */

/* M8 Patch 8: let the Setup panel grow with its contents. Chrome scrolls the
   document instead of trapping the final parameters in a short nested panel. */
html, body { min-height: 100%; }
/* Chrome must be able to reach the entire Setup page. Several legacy tablet/
   laptop rules lock .app-shell to the viewport and hide overflow; override the
   complete ancestor chain only while the Setup tab is active. */
html:has(body#dpxRoot.desktop-tab-layout.desktop-tab-setup) {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
}
body#dpxRoot.desktop-tab-layout.desktop-tab-setup {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow-y: visible !important;
}
body#dpxRoot.desktop-tab-layout.desktop-tab-setup .app-shell,
body#dpxRoot.desktop-tab-layout.desktop-tab-setup .desktop-tab-panels,
body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoTradingCard {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}
body#dpxRoot.desktop-tab-layout.desktop-tab-setup .app-shell { min-height: 100vh !important; }
body#dpxRoot.desktop-tab-layout.desktop-tab-setup .desktop-tab-panels { min-height: 0 !important; }
body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoTradingCard { padding-bottom: 32px !important; }

/* Wide Setup uses the space freed by removing 2m-60m entry/adjustment fields. */
.v073-settings-grid.m8-settings-grid {
  display: grid !important;
  grid-template-columns: minmax(330px, 1.02fr) minmax(380px, 1.08fr) minmax(300px, .9fr) !important;
  gap: 12px !important;
  align-items: start !important;
}
.m8-left-stack { gap: 12px !important; }
.m8-entry-card, .m8-adjustment-card, .m8-settlement-card, .v073-tools-card {
  padding: 10px !important;
  border-radius: 10px !important;
}
.auto-trading-card .auto-rule-details > summary,
.auto-trading-card .v073-subsection-title,
.auto-trading-card .flip-diagnostic-heading {
  font-size: 14px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

/* User-requested readability: make labels as large as practical, while giving
   numeric controls their own fixed minimum column so labels wrap rather than
   collide with values. */
.auto-trading-card .m8-one-minute-grid > label,
.auto-trading-card .m8-persistence-grid > label,
.auto-trading-card .m8-entry-filters > label,
.auto-trading-card .m8-settlement-basics > label,
.auto-trading-card .m8-shared-decline-row > label,
.auto-trading-card .m8-signal-grid > label,
.auto-trading-card .m8-kalman-params-row > label,
.auto-trading-card .v073-execution-grid > label,
.auto-trading-card .m8-safe-checkbox {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 150px) !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
  margin: 5px 0 !important;
}
.auto-trading-card .m8-one-minute-grid label > span,
.auto-trading-card .m8-persistence-grid label > span,
.auto-trading-card .m8-entry-filters label > span,
.auto-trading-card .m8-settlement-basics label > span,
.auto-trading-card .m8-shared-decline-row label > span,
.auto-trading-card .m8-signal-grid label > span,
.auto-trading-card .m8-kalman-params-row label > span,
.auto-trading-card .v073-execution-grid label > span,
.auto-trading-card .m8-safe-checkbox > span,
.auto-trading-card .m8-radio-field > span {
  font-size: 14px !important;
  line-height: 1.22 !important;
  font-weight: 750 !important;
  letter-spacing: 0 !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  min-width: 0 !important;
}
.auto-trading-card .m8-horizon-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  margin: 2px 0 6px !important;
}
.auto-trading-card .text-input,
.auto-trading-card .select-input,
.auto-trading-card .compact-select,
.auto-trading-card input[type="text"],
.auto-trading-card input[type="number"],
.auto-trading-card select {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 6px 11px !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
  font-variant-numeric: tabular-nums !important;
}
.auto-trading-card .mini-pair {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

/* Patch 5: native checkbox is the only pointer/touch toggle target. The text is
   deliberately not a label in index.html. Keep a large visible hit box and
   preserve native keyboard focus/Space behavior. */
.auto-trading-card .m8-safe-checkbox { cursor: default !important; }
.auto-trading-card .m8-safe-checkbox > span { cursor: text !important; user-select: text !important; }
.auto-trading-card .m8-safe-checkbox input[type="checkbox"] {
  justify-self: end !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  cursor: pointer !important;
  accent-color: auto;
}

/* M8 settlement radio group. Radio labels intentionally remain clickable as
   their text describes the choice; mutual exclusivity is native + persisted. */
.m8-settlement-mode-group {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 5px !important;
  margin: 8px 0 10px !important;
}
.m8-radio-field {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 34px !important;
  margin: 0 !important;
}
.m8-radio-field input[type="radio"] { width: 21px !important; height: 21px !important; margin: 0 !important; }

/* Keep Q/R/threshold on one row on wide screens, with a wider threshold cell. */
.v073-kalman-box > .m8-kalman-params-row {
  display: grid !important;
  grid-template-columns: minmax(100px, .8fr) minmax(100px, .8fr) minmax(190px, 1.5fr) !important;
  gap: 8px !important;
  width: 100% !important;
}
.v073-kalman-box > .m8-kalman-params-row > label {
  grid-template-columns: max-content minmax(72px, 1fr) !important;
  gap: 6px !important;
  font-size: inherit !important;
}

/* Historical OUT metrics may be longer than the former price-only string. */
.entry-exit-cell .entry-exit-stack em,
.phone-inout-cell em { white-space: nowrap !important; }

@media (min-width: 901px) and (max-width: 1280px) {
  .v073-settings-grid.m8-settings-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(340px, 1fr) !important;
  }
  .v073-settings-grid.m8-settings-grid > .v073-tools-card { grid-column: 1 / -1 !important; }
  .v073-tools-card .v073-execution-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px 16px !important; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .v073-settings-grid.m8-settings-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .v073-settings-grid.m8-settings-grid > .v073-tools-card { grid-column: 1 / -1 !important; }
  .auto-trading-card .m8-one-minute-grid > label,
  .auto-trading-card .m8-persistence-grid > label,
  .auto-trading-card .m8-entry-filters > label,
  .auto-trading-card .m8-settlement-basics > label,
  .auto-trading-card .m8-shared-decline-row > label,
  .auto-trading-card .m8-signal-grid > label,
  .auto-trading-card .v073-execution-grid > label,
  .auto-trading-card .m8-safe-checkbox {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 130px) !important;
  }
  .auto-trading-card .m8-one-minute-grid label > span,
  .auto-trading-card .m8-persistence-grid label > span,
  .auto-trading-card .m8-entry-filters label > span,
  .auto-trading-card .m8-settlement-basics label > span,
  .auto-trading-card .m8-shared-decline-row label > span,
  .auto-trading-card .m8-signal-grid label > span,
  .auto-trading-card .m8-kalman-params-row label > span,
  .auto-trading-card .v073-execution-grid label > span,
  .auto-trading-card .m8-safe-checkbox > span,
  .auto-trading-card .m8-radio-field > span { font-size: 13px !important; }
  .auto-trading-card .text-input,
  .auto-trading-card .select-input,
  .auto-trading-card .compact-select,
  .auto-trading-card input[type="text"],
  .auto-trading-card select { font-size: 15px !important; min-height: 38px !important; height: 38px !important; }
  .v073-kalman-box > .m8-kalman-params-row { grid-template-columns: 1fr !important; }
}

/* Phone portrait: one roomy column, same readable value font for all remaining
   Entry/Adjustment inputs. Values keep padding after the last character. */
@media (max-width: 600px) and (orientation: portrait) {
  body.phone-tab-layout .v073-settings-grid.m8-settings-grid,
  body.phone-tab-layout .phone-auto-panel .v073-settings-grid.m8-settings-grid { grid-template-columns: 1fr !important; gap: 9px !important; }
  body.phone-tab-layout .phone-auto-panel .m8-entry-card,
  body.phone-tab-layout .phone-auto-panel .m8-adjustment-card,
  body.phone-tab-layout .phone-auto-panel .m8-settlement-card,
  body.phone-tab-layout .phone-auto-panel .v073-tools-card { padding: 9px !important; }
  body.phone-tab-layout .phone-auto-panel .m8-one-minute-grid > label,
  body.phone-tab-layout .phone-auto-panel .m8-persistence-grid > label,
  body.phone-tab-layout .phone-auto-panel .m8-entry-filters > label,
  body.phone-tab-layout .phone-auto-panel .m8-settlement-basics > label,
  body.phone-tab-layout .phone-auto-panel .m8-shared-decline-row > label,
  body.phone-tab-layout .phone-auto-panel .m8-signal-grid > label,
  body.phone-tab-layout .phone-auto-panel .v073-execution-grid > label,
  body.phone-tab-layout .phone-auto-panel .m8-safe-checkbox {
    grid-template-columns: minmax(0, 1fr) minmax(128px, 148px) !important;
    gap: 8px !important;
    margin: 5px 0 !important;
  }
  body.phone-tab-layout .phone-auto-panel .m8-one-minute-grid label > span,
  body.phone-tab-layout .phone-auto-panel .m8-persistence-grid label > span,
  body.phone-tab-layout .phone-auto-panel .m8-entry-filters label > span,
  body.phone-tab-layout .phone-auto-panel .m8-settlement-basics label > span,
  body.phone-tab-layout .phone-auto-panel .m8-shared-decline-row label > span,
  body.phone-tab-layout .phone-auto-panel .m8-signal-grid label > span,
  body.phone-tab-layout .phone-auto-panel .m8-kalman-params-row label > span,
  body.phone-tab-layout .phone-auto-panel .v073-execution-grid label > span,
  body.phone-tab-layout .phone-auto-panel .m8-safe-checkbox > span,
  body.phone-tab-layout .phone-auto-panel .m8-radio-field > span {
    font-size: 14px !important;
    line-height: 1.18 !important;
  }
  body.phone-tab-layout .phone-auto-panel .text-input,
  body.phone-tab-layout .phone-auto-panel .select-input,
  body.phone-tab-layout .phone-auto-panel .compact-select,
  body.phone-tab-layout .phone-auto-panel input[type="text"],
  body.phone-tab-layout .phone-auto-panel input[type="number"],
  body.phone-tab-layout .phone-auto-panel select,
  html body#dpxRoot.phone-tab-layout #phoneEntryPanel .text-input[id^="autoEntryEst"],
  html body#dpxRoot.phone-tab-layout #phoneAdjustPanel .text-input[id^="autoAdjustEst"] {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 7px 12px !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
  }
  body.phone-tab-layout .phone-auto-panel .mini-pair { width: 148px !important; min-width: 128px !important; }
  body.phone-tab-layout .phone-auto-panel .v073-kalman-box > .m8-kalman-params-row { grid-template-columns: 1fr !important; }
  body.phone-tab-layout .phone-auto-panel .v073-kalman-box > .m8-kalman-params-row > label {
    grid-template-columns: minmax(0, 1fr) minmax(128px, 148px) !important;
  }
  body.phone-tab-layout .phone-auto-panel .m8-settlement-mode-group { gap: 7px !important; }
}

/* Phone landscape keeps laptop presentation but does not shrink M8 labels back
   to the legacy 7-8px values. */
@media (min-width: 601px) and (max-width: 1100px) and (max-height: 600px) and (orientation: landscape) {
  body.desktop-tab-layout .v073-settings-grid.m8-settings-grid { grid-template-columns: 1fr 1fr !important; gap: 7px !important; }
  body.desktop-tab-layout .v073-settings-grid.m8-settings-grid > .v073-tools-card { grid-column: 1 / -1 !important; }
  body.desktop-tab-layout .auto-trading-card label > span,
  body.desktop-tab-layout .auto-trading-card .m8-safe-checkbox > span,
  body.desktop-tab-layout .auto-trading-card .m8-radio-field > span { font-size: 12.5px !important; line-height: 1.18 !important; }
  body.desktop-tab-layout .auto-trading-card .text-input,
  body.desktop-tab-layout .auto-trading-card .select-input,
  body.desktop-tab-layout .auto-trading-card input[type="text"],
  body.desktop-tab-layout .auto-trading-card select { height: 36px !important; min-height: 36px !important; font-size: 14px !important; }
  body.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row { grid-template-columns: 1fr 1fr 1.5fr !important; }
  body.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row > label { font-size: inherit !important; }
}

/* Final M8 specificity guard: v0.7.3 compact Setup selectors are deliberately
   very specific and use !important. These selectors are loaded last and are
   scoped only to Auto Trade Setup so the M8 readable 1-minute controls win
   without changing unrelated trade inputs. */
html body#dpxRoot .auto-trading-card .v073-settings-grid label .text-input,
html body#dpxRoot .auto-trading-card .v073-settings-grid label .select-input,
html body#dpxRoot .auto-trading-card .v073-settings-grid label input[type="text"],
html body#dpxRoot .auto-trading-card .v073-settings-grid label input[type="number"],
html body#dpxRoot .auto-trading-card .v073-settings-grid label select {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: none !important;
  padding: 6px 11px !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
}
@media (min-width: 601px) and (max-width: 900px) {
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label .text-input,
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label .select-input,
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label input[type="text"],
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label select {
    height: 38px !important; min-height: 38px !important; font-size: 15px !important;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  html body#dpxRoot.phone-tab-layout .phone-auto-panel .v073-settings-grid label .text-input,
  html body#dpxRoot.phone-tab-layout .phone-auto-panel .v073-settings-grid label .select-input,
  html body#dpxRoot.phone-tab-layout .phone-auto-panel .v073-settings-grid label input[type="text"],
  html body#dpxRoot.phone-tab-layout .phone-auto-panel .v073-settings-grid label input[type="number"],
  html body#dpxRoot.phone-tab-layout .phone-auto-panel .v073-settings-grid label select {
    height: 42px !important; min-height: 42px !important; max-height: none !important;
    padding: 7px 12px !important; font-size: 16px !important; line-height: 1.1 !important;
  }
}
@media (min-width: 601px) and (max-width: 1100px) and (max-height: 600px) and (orientation: landscape) {
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label .text-input,
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label .select-input,
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label input[type="text"],
  html body#dpxRoot.desktop-tab-layout .auto-trading-card .v073-settings-grid label select {
    height: 36px !important; min-height: 36px !important; font-size: 14px !important;
  }
}

/* M8 landscape final fit guard: keep Q/R/threshold on one row without letting
   the long threshold label push its numeric field outside the viewport. */
@media (min-width: 601px) and (max-width: 1100px) and (max-height: 600px) and (orientation: landscape) {
  html body#dpxRoot.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row > label {
    grid-template-columns: minmax(24px, 1fr) minmax(64px, 68px) !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row > label > span {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }
  html body#dpxRoot.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row input[type="text"],
  html body#dpxRoot.desktop-tab-layout .v073-kalman-box > .m8-kalman-params-row input[type="number"] {
    width: 100% !important;
    min-width: 64px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }
}

/* Setup content-height guard for compact landscape/tablet rules inherited from
   older releases. The M8 cards must contribute their real height so the page
   can scroll to the final execution parameters instead of overflowing an
   invisible fixed-height grid. */
html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoConditionsGrid.m8-settings-grid {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  grid-auto-rows: max-content !important;
  align-items: start !important;
}

/* M8 readability guard for laptop/tablet/phone-landscape widths. Legacy rules
   split each settings subsection into two narrow cells, which can collapse a
   14px label to only a few pixels beside a 150px value field. Stack those rows
   instead; the page now scrolls normally, so readability takes priority over
   squeezing two controls onto one line. */
@media (max-width: 1400px) {
  html body#dpxRoot .auto-trading-card .m8-persistence-grid,
  html body#dpxRoot .auto-trading-card .m8-entry-filters,
  html body#dpxRoot .auto-trading-card .m8-settlement-basics,
  html body#dpxRoot .auto-trading-card .m8-signal-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================== 
   Patch-v0.8.1-1 corrective overrides
   ========================================================================== */

/* Patch 2: Chrome desktop Historical Orders needs enough room for the complete
   M8 OUT assessment: exit / move% (signed difference). */
@media (min-width: 1281px) {
  html body#dpxRoot.desktop-tab-layout #ledgerTableWrap #ledgerTable .ledger-col-entryExit,
  html body#dpxRoot.desktop-tab-layout #ledgerTableWrap #ledgerTable .entry-exit-cell {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
  }
  html body#dpxRoot.desktop-tab-layout #ledgerTableWrap #ledgerTable .entry-exit-stack,
  html body#dpxRoot.desktop-tab-layout #ledgerTableWrap #ledgerTable .entry-exit-stack .ledger-stack-line,
  html body#dpxRoot.desktop-tab-layout #ledgerTableWrap #ledgerTable .entry-exit-stack em {
    min-width: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
  }
}

/* Patch 3: desktop-PC readability + equal-height Setup columns. Do not split
   words just to fit a narrow label lane. */
@media (min-width: 1281px) {
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid {
    grid-template-columns: minmax(470px, 1.08fr) minmax(500px, 1.05fr) minmax(440px, .95fr) !important;
    gap: 14px !important;
    align-items: stretch !important;
    min-height: 650px !important;
    height: 650px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .m8-left-stack,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .m8-settlement-card,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .v073-tools-card {
    box-sizing: border-box !important;
    height: 650px !important;
    min-height: 650px !important;
    max-height: 650px !important;
    margin: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card {
    flex: 0 0 176px !important;
    min-height: 176px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card {
    overflow: hidden !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card {
    display: flex !important;
    flex-direction: column !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .flip-diagnostic-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoFlipDiagnosticLog {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 140px !important;
    max-height: none !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-persistence-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-entry-filters > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-settlement-basics > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-shared-decline-row > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-signal-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .v073-execution-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-safe-checkbox {
    grid-template-columns: minmax(165px, 1fr) minmax(135px, 175px) !important;
    gap: 10px !important;
    margin: 3px 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-one-minute-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-persistence-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-entry-filters label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-settlement-basics label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-shared-decline-row label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-signal-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-kalman-params-row label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .v073-execution-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-safe-checkbox > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-radio-field > span {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-persistence-grid {
    gap: 8px 14px !important;
  }
}

/* Patch 6: a modest desktop-only Flip Diagnostic body-font increase. */
@media (min-width: 1281px) {
  html body#dpxRoot.desktop-tab-layout .v073-tools-card #autoFlipDiagnosticLog,
  html body#dpxRoot.desktop-tab-layout .v073-tools-card #autoFlipDiagnosticLog .flip-diagnostic-event {
    font-size: 11px !important;
    line-height: 1.28 !important;
  }
}

/* Patch 9: pointer/touch selection belongs only to the visible radio circle.
   The text and row are intentionally not labels. Keyboard selection still works
   through the native focused radio input. */
.auto-trading-card .m8-radio-field { cursor: default !important; }
.auto-trading-card .m8-radio-field > span { cursor: text !important; user-select: text !important; }
.auto-trading-card .m8-radio-field input[type="radio"] { cursor: pointer !important; }

/* ========================================================================== 
   PC readability correction - 2026-09-21 live acceptance screenshot
   Scope: wide desktop PC only. Do not change laptop/tablet/phone layouts.
   ========================================================================== */
@media (min-width: 1500px) {
  /* Keep all three setup columns aligned while giving Adjustment enough height.
     Entry is intentionally shortened because M8 now has only one horizon. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid {
    grid-template-columns: minmax(590px, 1.08fr) minmax(575px, 1.02fr) minmax(500px, .95fr) !important;
    gap: 12px !important;
    height: 650px !important;
    min-height: 650px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .m8-left-stack,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .m8-settlement-card,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-settings-grid.m8-settings-grid > .v073-tools-card {
    height: 650px !important;
    min-height: 650px !important;
    max-height: 650px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack {
    gap: 10px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card {
    flex: 0 0 405px !important;
    height: 405px !important;
    min-height: 405px !important;
    max-height: 405px !important;
    overflow: hidden !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card {
    flex: 0 0 235px !important;
    height: 235px !important;
    min-height: 235px !important;
    max-height: 235px !important;
    overflow: hidden !important;
  }

  /* The three section names marked by the client are deliberately larger. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card > summary > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card > summary > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card > summary > span {
    font-size: 17px !important;
    line-height: 1.18 !important;
    font-weight: 850 !important;
    letter-spacing: .01em !important;
  }

  /* Larger desktop labels and values, but never split a word. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-one-minute-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-persistence-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-entry-filters label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-settlement-basics label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-shared-decline-row label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-signal-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-kalman-params-row label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .v073-execution-grid label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-safe-checkbox > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-radio-field > span {
    font-size: 15.5px !important;
    line-height: 1.16 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .m8-horizon-title {
    font-size: 14.5px !important;
    margin: 2px 0 5px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .text-input,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .select-input,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card .compact-select,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card input[type="text"],
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card input[type="number"],
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .auto-trading-card select {
    height: 42px !important;
    min-height: 42px !important;
    padding: 6px 12px !important;
    font-size: 17px !important;
  }

  /* Entry: use the freed one-minute-only width. This removes a full vertical row
     and gives the Adjustment section the height it needs. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px 12px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid .m8-horizon-title {
    grid-column: 1 / -1 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-persistence-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters > label {
    grid-template-columns: minmax(130px, 1fr) minmax(145px, 165px) !important;
    gap: 9px !important;
    margin: 2px 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-persistence-grid,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters {
    gap: 5px 12px !important;
    margin-top: 5px !important;
  }
  /* Checkbox rows need only a checkbox lane, not a 165px value lane. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters .m8-safe-checkbox {
    grid-template-columns: minmax(0, 1fr) 30px !important;
    gap: 8px !important;
    margin: 2px 0 !important;
  }

  /* Adjustment: compact, complete, and entirely visible inside its card. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px 12px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid .m8-horizon-title {
    grid-column: 1 / -1 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-persistence-grid > label {
    grid-template-columns: minmax(130px, 1fr) minmax(145px, 165px) !important;
    gap: 9px !important;
    margin: 2px 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-persistence-grid {
    gap: 5px 12px !important;
    margin-top: 5px !important;
  }

  /* Settlement has ample vertical room. Use it instead of squeezing two complex
     controls into the same horizontal row. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-settlement-basics,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-signal-grid {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-settlement-basics > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-shared-decline-row > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-signal-grid > label {
    grid-template-columns: minmax(210px, 1fr) minmax(155px, 190px) !important;
    gap: 12px !important;
    margin: 2px 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-settlement-mode-group {
    gap: 4px !important;
    margin: 6px 0 7px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-radio-field {
    min-height: 32px !important;
    gap: 10px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-safe-checkbox {
    grid-template-columns: minmax(0, 1fr) 30px !important;
    gap: 8px !important;
    margin: 3px 0 !important;
  }

  /* Q/R share a row; the long threshold label gets a full-width row underneath. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px 12px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row > label {
    grid-template-columns: max-content minmax(125px, 1fr) !important;
    gap: 8px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row > label:last-child {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(210px, max-content) minmax(155px, 190px) !important;
    justify-content: start !important;
  }

  /* Execution/cost column: give the values enough room to show full strings. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-subsection-title,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .flip-diagnostic-heading {
    font-size: 16px !important;
    line-height: 1.18 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid > label {
    grid-template-columns: minmax(0, 1fr) 205px !important;
    gap: 10px !important;
    margin: 2px 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid .v073-execution-mode {
    grid-template-columns: minmax(0, 1fr) 260px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoPaperExecutionMode {
    min-width: 260px !important;
    width: 260px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoSimulationSummary {
    font-size: 10.5px !important;
    line-height: 1.22 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoFlipDiagnosticLog,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoFlipDiagnosticLog .flip-diagnostic-event {
    font-size: 11.5px !important;
    line-height: 1.30 !important;
  }
}

/* Final wide-PC polish after 1907x916 acceptance capture. */
@media (min-width: 1500px) {
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card > summary > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card > summary > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card > summary > span {
    font-size: 18px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-persistence-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-persistence-grid > label {
    grid-template-columns: minmax(145px, 1fr) minmax(140px, 155px) !important;
  }
}

/* ========================================================================== 
   Wide-PC acceptance correction #2 - exact 1910x916 client viewport
   Scope: Chrome desktop PC only. Reallocate width from Entry/Settlement to the
   Execution/Diagnostic column and keep every label/value fully readable.
   ========================================================================== */
@media (min-width: 1500px) {
  /* Main Setup title requested larger by client. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoTradingCard .auto-heading .eyebrow {
    font-size: 19px !important;
    line-height: 1.12 !important;
    font-weight: 850 !important;
    letter-spacing: .01em !important;
  }

  /* Fixed proportional allocation for a ~1910px desktop viewport:
     narrower Entry + Settlement, substantially wider Execution/Diagnostic. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoConditionsGrid.v073-settings-grid.m8-settings-grid {
    grid-template-columns: minmax(520px, 31%) minmax(470px, 28%) minmax(0, 41%) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoConditionsGrid > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* First column: slightly narrower value controls leave more room for labels.
     Labels are left aligned for easier scanning and checkbox text is no longer
     visually floating in the middle of the row. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-persistence-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-persistence-grid > label {
    grid-template-columns: minmax(0, 1fr) 132px !important;
    gap: 8px !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack .m8-safe-checkbox > span {
    text-align: left !important;
    justify-self: stretch !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters .m8-safe-checkbox {
    grid-template-columns: minmax(0, 1fr) 28px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters .m8-safe-checkbox input[type="checkbox"] {
    justify-self: start !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack .mini-pair {
    width: 132px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  /* Shorten Entry because all M8 entry controls fit comfortably in fewer rows;
     give Adjustment enough room without increasing the total setup height. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card {
    flex: 0 0 390px !important;
    height: 390px !important;
    min-height: 390px !important;
    max-height: 390px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card {
    flex: 0 0 250px !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
  }

  /* Second column deliberately narrower. Value controls are also narrower,
     which preserves readable label lanes without forcing the right column offscreen. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-settlement-basics > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-shared-decline-row > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-signal-grid > label {
    grid-template-columns: minmax(0, 1fr) 150px !important;
    gap: 9px !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card label > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-safe-checkbox > span,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-radio-field > span {
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 10px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row > label {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 6px !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row > label:last-child {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1fr) 150px !important;
    gap: 9px !important;
  }

  /* Right column receives the freed width. No intrinsic-width child may expand
     the grid beyond the viewport. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-cost,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .flip-diagnostic-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid > label {
    grid-template-columns: minmax(0, 1fr) 185px !important;
    gap: 10px !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid .v073-execution-mode {
    grid-template-columns: minmax(0, 1fr) 225px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoPaperExecutionMode {
    width: 225px !important;
    min-width: 0 !important;
    max-width: 225px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid input,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid label > span {
    text-align: left !important;
    min-width: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoSimulationSummary {
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoFlipDiagnosticLog {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }
}

/* Final client-PC tuning after exact 1910x916 review. */
@media (min-width: 1500px) {
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoTradingCard .auto-heading .eyebrow {
    font-size: 21px !important;
    line-height: 1.1 !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup #autoConditionsGrid.v073-settings-grid.m8-settings-grid {
    grid-template-columns: minmax(520px, 31%) minmax(455px, 26%) minmax(0, 43%) !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card {
    flex-basis: 365px !important;
    height: 365px !important;
    min-height: 365px !important;
    max-height: 365px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card {
    flex-basis: 275px !important;
    height: 275px !important;
    min-height: 275px !important;
    max-height: 275px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-persistence-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card .m8-entry-filters > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-one-minute-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card .m8-persistence-grid > label {
    grid-template-columns: minmax(0, 1fr) 118px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-left-stack .mini-pair {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
  }
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-settlement-basics > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-shared-decline-row > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-signal-grid > label,
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-settlement-card .m8-kalman-params-row > label:last-child {
    grid-template-columns: minmax(0, 1fr) 140px !important;
  }
}

/* Client PC correction 2026-09-21: requested runtime-only layout tweak.
   PC view only. Give Entry Conditions more vertical room and widen the
   execution Mode selector so "Coinbase Simulation" is fully visible. */
@media (min-width: 1500px) {
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-entry-card {
    flex-basis: 405px !important;
    height: 405px !important;
    min-height: 405px !important;
    max-height: 405px !important;
  }

  /* Keep the overall left column close to its existing height by using the
     unused lower space in Adjustment Conditions. */
  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .m8-adjustment-card {
    flex-basis: 235px !important;
    height: 235px !important;
    min-height: 235px !important;
    max-height: 235px !important;
  }

  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card .v073-execution-grid .v073-execution-mode {
    grid-template-columns: minmax(0, 1fr) 300px !important;
  }

  html body#dpxRoot.desktop-tab-layout.desktop-tab-setup .v073-tools-card #autoPaperExecutionMode {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
  }
}


/* DPX v0.8.2 patch-2: Trading Area readability and compact inline market/preset layout.
   Desktop/PC only. Phone/tablet responsive behavior is intentionally untouched. */
@media (min-width: 901px) and (min-height: 601px) {
  html body#dpxRoot.desktop-tab-layout #accountMenuBtn {
    font-size: 16px !important;
    line-height: 1.15 !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card #effectiveTradeSettings {
    font-size: 12px !important;
    line-height: 1.18 !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card .preset-field .field-label {
    font-size: 11px !important;
    line-height: 14px !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card .prediction-table-head {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-info-cell,
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-info-cell .prediction-countdown-value {
    font-size: 13px !important;
    line-height: 1.18 !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card .prediction-action-cell .pred-side {
    font-size: 18px !important;
  }
  html body#dpxRoot.desktop-tab-layout .trade-card .prediction-action-cell .pred-minute,
  html body#dpxRoot.desktop-tab-layout .trade-card .prediction-action-cell .pred-conf {
    font-size: 12px !important;
  }

  /* Patch 3: compact symbol picklist + Preset stake on the same row. */
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .demo-layout > .trade-card > .trade-market-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(360px, 1fr) 132px !important;
    gap: 10px !important;
    align-items: end !important;
    width: 86% !important;
    max-width: 86% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .trade-card .trade-market-row > .trade-symbol-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .trade-card .trade-market-row > .trade-symbol-control #symbolSelect {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 14px !important;
  }
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .trade-card .trade-market-row > .preset-field {
    display: grid !important;
    grid-template-rows: 15px 35px !important;
    width: 132px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .trade-card .trade-market-row > .preset-field #presetPercentSelect {
    width: 132px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    height: 35px !important;
    font-size: 14px !important;
  }
  html body#dpxRoot.desktop-tab-layout.v053-laptop-inline-preset .trade-card .trade-market-row > .mini-price-panel {
    display: none !important;
  }
}

/* DPX v0.8.2 PC prediction-metrics readability correction (18px max-safe font patch).
   User-requested red-box area only: Target Exit / Est. $ / Est. % / Count down.
   Large desktop only so laptop/tablet/phone layouts remain unchanged. */
@media (min-width: 1401px) and (min-height: 601px) {
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions.prediction-table-layout {
    grid-template-columns: minmax(220px, 1fr) 124px 84px 78px 110px !important;
    column-gap: 6px !important;
  }

  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-table-head:not(.prediction-button-head) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding-inline: 2px !important;
    font-size: 18px !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: center !important;
  }

  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-info-cell,
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-info-cell .prediction-countdown-value {
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding-inline: 2px !important;
    font-size: 18px !important;
    line-height: 1.12 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .target-exit-cell,
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .tp-dollar-cell,
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .tp-pct-cell,
  html body#dpxRoot.desktop-tab-layout .trade-card #predictions > .prediction-countdown-cell {
    justify-content: center !important;
    text-align: center !important;
  }
}
