/* Mobile-mode geometry; narrow-screen controls are also protected below. */
html body.mode-mobile #betting-workspace #tabs-area .quick-bet-form__input-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 56px 60px !important;
  gap: 8px !important;
  align-items: end !important;
}
html body.mode-mobile #betting-workspace #tabs-area .quick-bet-form__input-row:not(:has(button[onclick="toggleReverse()"])) {
  grid-template-columns: minmax(0, 1fr) 60px !important;
}
html body.mode-mobile #betting-workspace #tabs-area .quick-bet-form__input-row .number-input-field {
  min-width: 0 !important;
  width: auto !important;
}
html body.mode-mobile #betting-workspace #tabs-area .quick-bet-form__input-row > button {
  position: static !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding-inline: 4px !important;
  box-sizing: border-box;
}
html body.mode-mobile #betting-workspace #tabs-area .quick-bet-form__input-row #num-input {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item {
  display: grid !important;
  grid-template-columns: minmax(76px, 26%) minmax(0, 1fr) 40px !important;
  align-items: stretch !important;
  column-gap: 6px !important;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item__meta {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  text-align: center !important;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item__meta > :is(span, div) {
  width: 100% !important;
  text-align: center !important;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item > div:nth-child(2) {
  min-width: 0 !important;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item__numbers {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box;
}
html body.mode-mobile #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list button.cart-item__delete.w-10 {
  position: static !important;
  justify-self: center !important;
  align-self: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Phones must fit the controls even with a saved desktop preference.
   Action columns follow their content, including larger text. */
@media (max-width: 767px) {
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-form__input-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content max-content !important;
    gap: 8px !important;
    align-items: end !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-form__input-row:not(:has(button[onclick="toggleReverse()"])) {
    grid-template-columns: minmax(0, 1fr) max-content !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .number-input-field,
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .price-entry-row__fields,
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .price-field {
    min-width: 0 !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .number-input-field {
    width: auto !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .number-input-field label {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area #num-input {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-form__input-row > button {
    position: static !important;
    width: auto !important;
    min-width: 56px !important;
    height: auto !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    box-sizing: border-box;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area #btn-ok {
    min-width: 60px !important;
    height: auto !important;
    min-height: 42px !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-form__input-row > button,
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-form__input-row > button span {
    line-height: 1.3 !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .price-entry-row {
    grid-template-columns: minmax(0, 1fr) max-content !important;
  }
  html body:is(.mode-mobile, .mode-desktop) #betting-workspace #tabs-area .quick-bet-add {
    height: auto !important;
    min-height: 42px !important;
  }
}
