/* Mobile-only presentation fix for Result-Based Trading.
   The existing result-based-strategy.js remains the state/execution authority. */

/* When Result-Based Trading is off, keep the block to one compact switch row.
   When checked, reveal the primary-route note and the already-rendered recovery editor. */
.result-routing-section:has(#result-routing-enabled:not(:checked)) .result-routing-primary-note,
.result-routing-section:has(#result-routing-enabled:not(:checked)) .result-routing-recovery-box {
  display: none !important;
}

.result-routing-section:has(#result-routing-enabled:checked) .result-routing-primary-note {
  display: block !important;
}

.result-routing-section:has(#result-routing-enabled:checked) .result-routing-recovery-box {
  display: grid !important;
}

@media (max-width: 760px) {
  .result-routing-section {
    padding: 8px 10px !important;
  }

  .result-routing-section .section-label {
    margin: 0 0 5px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  label.result-routing-toggle,
  .result-routing-toggle {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 24px !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border-radius: 12px !important;
  }

  .result-routing-toggle > span {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .result-routing-toggle strong {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .result-routing-toggle small {
    width: auto !important;
    max-width: none !important;
    margin: 2px 0 0 !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .result-routing-toggle input[type="checkbox"] {
    display: block !important;
    justify-self: end !important;
    align-self: center !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .result-routing-primary-note {
    width: 100% !important;
    max-width: none !important;
    margin: 6px 0 0 !important;
    padding: 8px 11px !important;
    border-radius: 11px !important;
  }

  .result-routing-primary-note strong {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .result-routing-primary-note small {
    margin-top: 2px !important;
    font-size: 9.5px !important;
    line-height: 1.3 !important;
  }

  .result-routing-recovery-box {
    width: 100% !important;
    max-width: none !important;
    margin: 6px 0 0 !important;
    padding: 10px !important;
    border-radius: 11px !important;
  }
}
