/* BUILT Business — iPad layout lock.
 * One tablet contract in both orientations. iPad portrait (744–834 CSS px) used to fall into the
 * phone breakpoints (≤900px) while landscape (1024–1366) used the desktop ones, so the same tool
 * changed shape when the iPad rotated. Tablets (coarse pointer, 700–1366px) now keep the floating
 * dialog chrome and desktop controls whichever way they are held. Phones and desktops are untouched.
 */
@media (min-width:700px) and (max-width:1366px) and (pointer:coarse) {
  /* ---------- shared tool dialogs (Time Clock, Warranties, Inventory, Coupons, Reports, Catalog…) ---------- */
  html body :is(.bw-dialog,.brv-dialog,.shop-integrations-dialog,.stock-dialog,.coupon-dialog,.quote-followups-dialog,.bte-dialog,.catalog-library-dialog,.catalog-connections-dialog,.btc-dialog,.bjp-dialog,.brr-dialog,.catalog-dialog){
    width:min(1280px,calc(100vw - 32px));height:fit-content;max-height:calc(100dvh - 32px);margin:auto;
    border:1px solid var(--tp-line,#24242a);border-radius:22px;
  }
  html body :is(.bw-head,.brv-head,.shop-integrations-head,.stock-head,.coupon-head,.followup-head,.bte-head,.catalog-library-head,.catalog-connections-head,.btc-head,.bjp-head,.brr-head,.catalog-head){padding:18px 28px}
  html body :is(.bw-head,.brv-head,.shop-integrations-head,.stock-head,.coupon-head,.followup-head,.bte-head,.catalog-library-head,.catalog-connections-head,.btc-head,.bjp-head,.brr-head,.catalog-head) h1{font-size:26px}
  html body :is(.bw-body,.brv-body,.shop-integrations-body,.stock-body,.coupon-body,.followup-body,.bte-body,.catalog-library-body,.catalog-connections-body,.btc-body,.bjp-body,.brr-body,.catalog-body){padding:22px 28px 24px}
  html body :is(.bw-fields,.stock-fields,.bte-fields,.catalog-library-fields,.btc-fields,.bjp-fields,.brr-fields,.catalog-fields,.coupon-fields,.followup-settings-grid,.profit-editor-grid){grid-template-columns:repeat(2,minmax(0,1fr))}
  html body .btc-timer{font-size:44px}
  /* Size the dialog to its content: the body only grows to fill when content overflows and scrolls. */
  html body :is(.bw-body,.brv-body,.shop-integrations-body,.stock-body,.coupon-body,.followup-body,.bte-body,.catalog-library-body,.catalog-connections-body,.btc-body,.bjp-body,.brr-body,.catalog-body){flex:0 1 auto;min-height:0}
  html body[data-built-client="business"][data-business-ui="workspace"] dialog.btc-dialog[open] .btc-body{align-content:start!important}

  /* ---------- My Schedule ---------- */
  html body .bes-dialog.bes-dialog{width:min(1360px,calc(100vw - 32px));height:calc(100dvh - 32px);max-width:none;margin:auto;border:1px solid var(--bes-line,#24242a);border-radius:22px}
  html body .bes-dialog.bes-dialog .bes-head{padding:24px 28px}
  html body .bes-dialog.bes-dialog .bes-head h1{font-size:27px}
  html body .bes-dialog.bes-dialog .bes-head-actions [data-schedule-action="print"]{display:inline-flex}
  html body .bes-dialog.bes-dialog .bes-body{padding:24px 28px}
  html body .bes-dialog.bes-dialog .bes-tabs{max-width:340px;margin:0 0 22px;padding:5px;overflow:visible}
  html body .bes-dialog.bes-dialog .bes-tabs .bes-button{flex:1;padding:0 14px}
  html body .bes-dialog.bes-dialog .bes-period{flex-direction:row;align-items:center;gap:20px}
  html body .bes-dialog.bes-dialog .bes-period-nav{width:auto;justify-content:flex-start;flex-direction:row}
  html body .bes-dialog.bes-dialog .bes-period h2{font-size:20px;white-space:nowrap}
  html body .bes-dialog.bes-dialog .bes-period-tools{width:auto}
  html body .bes-dialog.bes-dialog .bes-calendar-modes{flex:0 0 auto}
  html body .bes-dialog.bes-dialog .bes-calendar-modes .bes-button{flex:0 0 auto}

  /* ---------- top bar search stays a real field, not an icon ---------- */
  html body[data-built-client="business"][data-business-ui="workspace"][data-business-entry="workspace"] .bxr-search{width:auto;min-width:240px;padding:0 8px 0 14px;justify-content:flex-start}
  html body[data-built-client="business"][data-business-ui="workspace"][data-business-entry="workspace"] .bxr-search span{display:inline}
}
