/* DPX v0.7.1 M7-8 focused responsive additions. Loaded after preserved v0.6.12 CSS. */
.m7-protection-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}
.m7-protection-box{border:1px solid rgba(148,163,184,.28);border-radius:10px;padding:8px;display:grid;gap:6px;min-width:0;align-content:start}
.m7-protection-box>strong{font-size:11px;line-height:1.15;letter-spacing:.035em;overflow-wrap:anywhere}
.m7-protection-box label{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(54px,82px);align-items:center;gap:5px}
.m7-protection-box label>span{min-width:0;font-size:10px!important;line-height:1.08!important;letter-spacing:0!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;text-align:right!important;padding-right:0!important}
.m7-protection-box .checkbox-field{grid-template-columns:minmax(0,1fr) auto}
.m7-protection-box .text-input,.m7-protection-box .select-input{box-sizing:border-box!important;width:82px!important;max-width:82px!important;min-width:54px!important;height:27px!important;min-height:27px!important;padding:3px 5px!important;font-size:10.5px!important;line-height:1!important}
.m7-protection-box input[type="checkbox"]{width:17px!important;height:17px!important}
.m7-simulation-box{grid-template-columns:1fr}
.m7-simulation-box label{grid-template-columns:minmax(0,1fr) minmax(74px,96px)}
.m7-simulation-box .text-input{width:96px!important;max-width:96px!important}
.m7-simulation-box .select-input{width:190px!important;max-width:190px!important;font-size:9.5px!important;padding-right:18px!important}
.m7-simulation-summary{grid-column:1/-1;font-size:10px;line-height:1.3;overflow-wrap:anywhere}
#autoConditionsGrid input,#autoConditionsGrid select,#autoConditionsGrid textarea{min-width:0;max-width:100%;box-sizing:border-box}

/* Same-name PC correction, 2026-09-02.
   Keep the first two logic columns only as wide as their content needs, move the
   Edit Logic controls left, and reserve the recovered width for Auto Trade Setting. */
@media (min-width:1600px) and (min-height:601px){
  .auto-collapsible-grid.logic-expanded-view,
  .auto-collapsible-grid{
    grid-template-columns:minmax(455px,.86fr) minmax(455px,.86fr) minmax(560px,1.28fr)!important;
    column-gap:8px!important;
  }
  .auto-trading-card .horizon-param-grid.six-horizon-grid,
  .auto-trading-card .six-horizon-grid{
    grid-template-columns:108px repeat(6,46px)!important;
    column-gap:5px!important;
  }
  .auto-trading-card .horizon-param-grid.six-horizon-grid .horizon-row-label,
  .auto-trading-card .six-horizon-grid .horizon-row-label{
    width:108px!important;min-width:108px!important;max-width:108px!important;padding-right:7px!important;
  }
  .auto-trading-card .horizon-param-grid.six-horizon-grid .horizon-grid-head,
  .auto-trading-card .six-horizon-grid .horizon-grid-head,
  .auto-trading-card .horizon-param-grid.six-horizon-grid .text-input,
  .auto-trading-card .six-horizon-grid .text-input,
  .auto-trading-card .horizon-param-grid.six-horizon-grid input,
  .auto-trading-card .six-horizon-grid input{
    width:46px!important;max-width:46px!important;min-width:42px!important;
  }
  .auto-trading-card .logic-field>span{
    justify-content:flex-start!important;
    gap:8px!important;
    text-align:left!important;
  }
  .auto-trading-card .logic-field .logic-toggle{margin-left:6px!important;margin-right:0!important;flex:0 0 auto!important}
  .combined-settlement-risk .auto-setting-split{column-gap:10px!important}
  .m7-protection-groups{grid-template-columns:minmax(0,.92fr) minmax(0,.92fr) minmax(0,1.16fr)}
}

/* Laptop/tablet widths keep the three main setup cards usable by stacking M7
   sub-groups before their labels become too narrow. */
@media (min-width:981px) and (max-width:1599px){
  .m7-protection-groups{grid-template-columns:repeat(2,minmax(0,1fr))}
  .m7-simulation-box{grid-column:1/-1}
}
@media(max-width:1100px){.m7-protection-groups{grid-template-columns:1fr 1fr}.m7-simulation-box{grid-column:1/-1}}
@media(max-width:700px){.m7-protection-groups{grid-template-columns:1fr}.m7-simulation-box{grid-column:auto}.m7-protection-box label{grid-template-columns:minmax(0,1fr) minmax(72px,34%)}.m7-protection-box .text-input,.m7-protection-box .select-input{width:100%!important;max-width:100%!important}.m7-simulation-box label{grid-template-columns:minmax(0,1fr) minmax(88px,38%)}}
@media(max-height:460px) and (orientation:landscape) and (max-width:1100px){#autoConditionsGrid,.phone-auto-panel{overflow-y:auto;max-height:calc(100vh - 120px)}.m7-protection-groups{grid-template-columns:repeat(2,minmax(0,1fr));overflow-x:visible}.m7-simulation-box{grid-column:1/-1}.m7-protection-box{min-width:0}}

@media(max-width:700px){.entry-min-est-label{white-space:normal!important;line-height:1.02!important}.entry-min-est-label .entry-only-note{display:block!important}}


/* patch-v0.7.1-2 — Auto Paper Execution readability.
   Keep the field group left-aligned and give Mode enough width for the complete
   "Coinbase Simulation" label without changing execution behavior. */
@media (min-width:901px) and (min-height:601px){
  .m7-simulation-box{grid-column:1/-1!important}
  .m7-simulation-box label{grid-template-columns:150px 190px!important;justify-content:start!important}
  .m7-simulation-box .text-input{width:152px!important;max-width:152px!important}
  .m7-simulation-box .select-input{width:190px!important;max-width:190px!important;font-size:10px!important;padding-left:7px!important;padding-right:20px!important}
}

/* patch-v0.7.1-2 — Historical Orders Reason text must remain inside its own
   column. Row height is allowed to expand; no reason may bleed into prediction
   columns to the right. */
@media (min-width:901px) and (min-height:601px){
  html body.desktop-tab-layout.user-admin #ledgerTable .ledger-col-closeReason,
  html body.desktop-tab-layout.user-admin #ledgerTable .reason-cell,
  html body.desktop-tab-layout.admin-unlocked #ledgerTable .ledger-col-closeReason,
  html body.desktop-tab-layout.admin-unlocked #ledgerTable .reason-cell{
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:clip!important;
    vertical-align:top!important;
  }
  html body.desktop-tab-layout.user-admin #ledgerTable .dpx-ledger-reason-text,
  html body.desktop-tab-layout.admin-unlocked #ledgerTable .dpx-ledger-reason-text,
  html body.desktop-tab-layout.user-admin #ledgerTable .dpx-ledger-reason-single,
  html body.desktop-tab-layout.admin-unlocked #ledgerTable .dpx-ledger-reason-single,
  html body.desktop-tab-layout.user-admin #ledgerTable .dpx-ledger-reason-flip,
  html body.desktop-tab-layout.admin-unlocked #ledgerTable .dpx-ledger-reason-flip{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    line-height:1.18!important;
    max-height:none!important;
    -webkit-line-clamp:unset!important;
    line-clamp:unset!important;
  }
}

/* Same-name v0.7.1 mode-width hotfix: keep the widened option readable in
   short phone-landscape layouts without pushing the select outside viewport. */
@media(max-height:460px) and (orientation:landscape) and (max-width:1100px){
  .m7-simulation-box label{grid-template-columns:minmax(0,1fr) 160px!important}
  .m7-simulation-box .select-input{width:160px!important;max-width:160px!important;min-width:0!important}
}
