.trade-app { background: #f1f1f1; }
.trade-app .trade-form,.trade-app .trade-register { margin: 0; background: #f8f8f8; border: 0; border-radius: 0; }
.trade-form { min-height: calc(100% - 42px); display: flex; flex-direction: column; }
.trade-form .form-top { padding: 0 6% 5px 2%; gap: 7%; align-items: start; }
.trade-form .field { margin: 3px 0; }
.trade-form .form-top .field { grid-template-columns: minmax(72px, .72fr) minmax(80px, 1.8fr); }
.trade-form .form-top select, .trade-form .form-top input { width: 100%; }
.trade-sourcebar,.trade-actions,.trade-subtabs,.trade-foot,.trade-list-filters,.trade-extra-filters,.trade-match-summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trade-sourcebar { margin: 2px 0 7px; color: #505965; }
.trade-sourcebar:empty { display: none; }
.trade-sourcebar select { max-width: min(460px,100%); }
.trade-subtabs { gap: 0; border-bottom: 1px solid #a5a9ae; margin-top: 3px; }
.trade-subtabs button { background: #e4e4e4; border: 1px solid #b7b7b7; border-bottom: 0; border-radius: 3px 3px 0 0; padding: 6px 14px; color: #444; min-height: 32px; }
.trade-subtabs button[aria-selected=true] { border-top: 3px solid #ed3969; background: #fff; color: #242424; }
.trade-pane { flex: 1; background: #fff; border: 1px solid #bfc1c3; border-top: 0; padding: 10px; min-height: 185px; }
.trade-items thead th:first-child { width: 33%; }
.trade-items td:nth-child(2),.trade-items td:nth-child(4),.trade-items td:nth-child(7) { white-space: nowrap; }
.trade-items tbody td:nth-child(3),.trade-items tbody td:nth-child(6) { width: 85px; }
.trade-items td:nth-child(5) { width: 115px; }
.trade-form input[readonly] { color: #444; background: #f2f2f2; }
.trade-form .trade-fields { max-width: 740px; display: grid; grid-template-columns: 1fr; gap: 4px; }
.trade-fields select,.trade-fields input { min-width: 0; width: 100%; }
.trade-note { color: #5d6368; margin: 9px 0; }
.trade-foot { min-height: 56px; justify-content: flex-end; background: #f8f8f8; border-top: 1px solid #d3d5d8; padding: 6px 2px; }
.trade-foot .field-error { flex: 1 1 200px; }
.trade-foot .entry-total { margin-right: 12px; }
.trade-list-filters { padding: 6px 0; border-bottom: 1px solid #ddd; }
.trade-list-filters input { max-width: 147px; }
.trade-extra-filters { padding: 6px; border-bottom: 1px solid #d4d9de; background: #f0f3f7; align-items: flex-end; }
.trade-extra-filters .field { display: flex; flex-direction: column; align-items: stretch; gap: 1px; margin: 0; }
.trade-grow { flex: 1; }
.trade-grid th { padding: 0; }
.trade-grid th button { color: inherit; background: none; border: 0; padding: 7px; border-radius: 0; text-align: left; width: 100%; font: inherit; white-space: nowrap; }
.trade-grid th button:hover { background: #d4e1ef; }
.trade-match-summary { justify-content: flex-start; gap: 18px; background: #f4f7fa; border-block: 1px solid #dde3e9; padding: 8px; margin: 8px 0; }
.trade-match-summary b { display: block; font-size: 17px; }
.trade-actions { margin: 6px 0; }
.trade-source-table { overflow: auto; max-height: 54vh; }
#trade-source-search { width: min(360px,100%); margin-bottom: 6px; }
.trade-related { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding-block: 8px; }
.trade-detail-modal { max-width: min(780px,95vw); }
.trade-detail-modal .modal-foot { flex-wrap: wrap; }
.trade-detail-modal .trade-subtabs { margin: 0 0 10px; }
@media(max-width:700px){
  .trade-form .form-top { padding: 0; gap: 4px; }
  .trade-form .form-top .field { grid-template-columns: minmax(75px,.65fr) minmax(100px,1.7fr); }
  .trade-list-filters { gap: 4px; }
  .trade-list-filters input { min-width: 103px; max-width: 27%; }
  .trade-subtabs button { padding: 6px 8px; font-size: 13px; }
  .trade-grid,.trade-items { min-width: 710px; }
  .trade-foot { position: static; }
}
@media print {
  body:has(.trade-detail-modal) #app,body:has(.trade-detail-modal) #status,.trade-detail-modal .modal-foot,.trade-detail-modal .tool,.trade-detail-modal .trade-subtabs { display: none!important; }
  body:has(.trade-detail-modal) #overlay,body:has(.trade-detail-modal) .modal-back,.trade-detail-modal { position: static!important; display: block!important; background: white!important; box-shadow: none!important; border: 0!important; max-width: 100%!important; max-height: none!important; }
  .trade-detail-modal .modal-head { color: black; background: white; }
}

.trade-quantities tr > :is(:nth-child(5),:nth-child(6),:nth-child(7)) { display: none; }
.trade-fields input[type=checkbox] { width: 17px; height: 17px; justify-self: start; }
