/* Short controls fit their content; long descriptions and touch actions retain room. */
.master-form[data-master-form=record] {max-width:58rem}
.master-record-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,20rem),1fr));gap:1rem}
.master-record-fields > label {min-width:0}
.master-record-fields > .master-long-field {grid-column:1 / -1}
.master-form > *, .master-form .partner-tag-picker > * {min-width:0}
.master-form .partner-tag-chip {max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}
.master-form .partner-tag-remove {flex-shrink:0}
.master-form-actions {display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}
.master-form-actions > button {width:auto;max-width:100%;white-space:normal}
@media (min-width:760px) {
  form :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color])),
  form select {max-width:32rem}
  form input:is([type=date],[type=month],[type=time],[type=number],[type=tel],[name=tax_id],[name=phone],[name=default_unit_price_twd]) {max-width:18rem}
  form .field > :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {display:block}
  form textarea, form input:is([name=notes],[name=bank_note],[name=description],[name=purpose],[name=project_name]) {max-width:48rem}
  form > :is(.button,.btn), form > fieldset > :is(.button,.btn), .master-form fieldset > .button {justify-self:start;width:auto;max-width:100%;white-space:normal}
  .button-row {display:flex;flex-wrap:wrap;align-items:end}
  .button-row > :is(.button,.btn), .quote-actions > .button {width:auto;flex:0 1 auto;max-width:100%;white-space:normal}
  .request-workspace form > .btn.full {width:auto;max-width:100%}
  form :is(button.button,button.btn) {width:fit-content;max-width:100%;justify-self:start;flex-grow:0;white-space:normal}
  form .button.full {width:fit-content}
  .quote-editor-summary .quote-actions {display:flex;flex-wrap:wrap}
  .request-selector-search {display:flex;flex-wrap:wrap;align-items:center;max-width:48rem}
  .request-selector-search > :is(input,select) {flex:0 1 20rem;width:20rem;max-width:100%}
  .request-selector-search > [role=status] {flex-basis:100%}
  /* Multi-line editors and upload overlays are intentionally not bounded as short fields. */
  .partner-tag-picker input[data-tag-input] {max-width:none}
}
