/* A short quantity, a searchable name and a date each need a different measure. */
body[data-screen="inventory"] {
  --stock-control: 40px;
  --stock-label: 13px;
  --stock-body: 15px;
}
.stock-panel.card, .stock-records.card {
  padding: clamp(18px, 1.55vw, 26px);
  margin-block: 16px;
}
.stock-panel .stock-heading { gap: 12px; }
.stock-panel .stock-heading h2, #app > .stock-records > h2:first-child {
  font-size: clamp(20px, 1.3vw, 22px);
  line-height: 1.35;
  font-weight: 650;
  margin: 0 0 4px;
}
.stock-panel .stock-heading p, .stock-records > p, .stock-panel [data-count] {
  color: #51655a;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}
.stock-panel > [data-count] { margin-top: 10px; font-size: var(--stock-label); }
:is(.stock-panel,.stock-records) p[data-error]:empty { display:none; }
.stock-panel .stock-tools { align-items:center; gap:14px; margin:16px 0 14px; }
.stock-panel .stock-tools [data-count] { padding:0; }
:is(.stock-panel,.stock-records) .stock-tools .proc-check {
  align-self:center; min-height:var(--stock-control); margin:0; gap:8px; font-size:14px;
}
:is(.stock-panel,.stock-records,.shipping-editor) :is(button,select,input:not([type=checkbox],[type=radio],[type=file])) {
  box-sizing:border-box; height:var(--stock-control); min-height:var(--stock-control);
  line-height:1.35; font-size:14px; border-radius:7px;
}
:is(.stock-panel,.stock-records,.shipping-editor) button { padding:0 16px; font-weight:600; }
:is(.stock-panel,.stock-records,.shipping-editor) input:not([type=checkbox],[type=radio],[type=file]),
:is(.stock-panel,.stock-records,.shipping-editor) select { padding:0 11px; }
.stock-panel .stock-tools.search-last > input[type=search],
.stock-records .stock-tools.search-last > label:has(input[type=search]) {
  flex:0 1 clamp(235px,20vw,320px); max-width:320px; margin-inline-start:auto;
}
.stock-records .stock-tools { gap:10px 12px; margin:14px 0 8px; }
.stock-records .stock-tools label, .shipping-editor form label {
  font-size:var(--stock-label); line-height:1.4; font-weight:550; color:#435c4d; gap:5px;
}
.stock-records .stock-tools select { min-width:8.5em; }
.stock-records .stock-tools input[type=date] { width:10.6em; }
.stock-records [data-results] > .muted { font-size:var(--stock-label); margin:8px 0 10px; }
.stock-panel table, .stock-records table { font-variant-numeric:tabular-nums; }
:is(.stock-panel,.stock-records) th { font-size:var(--stock-label); font-weight:600; color:#475d50; line-height:1.45; padding:9px 12px; white-space:nowrap; }
:is(.stock-panel,.stock-records) td { font-size:var(--stock-body); line-height:1.45; padding:10px 12px; }
.stock-panel .stock-product { gap:12px; min-width:185px; max-width:30em; }
.stock-panel .stock-product strong { font-size:16px; line-height:1.45; font-weight:650; }
.stock-panel .stock-product p, .stock-records td p.muted { margin:3px 0 0; font-size:var(--stock-label); }
.stock-panel :is(.stock-product img,.stock-image-empty) { width:52px; height:52px; border-radius:7px; }
.stock-panel .stock-balance { font-size:17px; line-height:1.45; }
.stock-panel .stock-table-wrap { overflow-x:auto; }
.stock-panel .stock-action { width:10rem; }
.stock-panel td[data-stock-field="本次入库数量"] { width:10rem; }
.stock-panel .stock-quantity { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:#51655a; }
#app .stock-inbound .stock-quantity input[data-qty] {
  width:6.25rem; min-width:0; max-width:100%; margin:0; font-variant-numeric:tabular-nums;
}
.stock-panel :is(.stock-action button,button[data-outbound]) { min-width:76px; }
.stock-panel input[type=checkbox] { width:18px; height:18px; margin:0; vertical-align:middle; }
.stock-inbound th:first-child,.stock-inbound td:first-child { width:3.6rem; text-align:center; }
.stock-records [data-results] { overflow-x:auto; }
.shipping-editor { --stock-control:40px; --stock-label:13px; }
.shipping-editor .shipping-section-heading h3 { font-size:17px; }
@media(max-width:1050px) and (min-width:761px) {
  .stock-panel table { min-width:780px; }
  .stock-records .stock-tools.search-last > label:has(input[type=search]) { flex:1 1 190px; }
}
@media(max-width:760px) {
  body[data-screen="inventory"],.shipping-editor { --stock-control:44px; }
  .stock-panel.card,.stock-records.card { padding:16px; }
  .stock-panel .stock-heading { align-items:flex-start; }
  .stock-panel .stock-tools { flex-wrap:wrap; gap:8px 14px; margin:12px 0; }
  .stock-panel .stock-tools.search-last > input[type=search] { flex:1 1 100%; width:100%; min-width:0; max-width:none; margin:0; }
  .stock-records .stock-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stock-records .stock-tools :is(select,input[type=date]) { width:100%; min-width:0; }
  .stock-records .stock-tools [data-reset] { width:max-content; }
  .stock-records .stock-tools.search-last > label:has(input[type=search]) { grid-column:1/-1; min-width:0; width:100%; max-width:none; margin:0; }
  .stock-panel .stock-table-wrap table,.stock-panel .stock-table-wrap tbody { display:block; min-width:0; width:100%; }
  .stock-panel thead { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
  .stock-panel tr[data-row]:not([hidden]) {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 6px;
    align-items:start; padding:12px 0; border-block-start:1px solid var(--line);
  }
  .stock-panel tr[data-row] td { min-width:0; width:auto; padding:0; border:0; }
  .stock-panel td[data-stock-field="产品 / SKU"] { grid-row:1; grid-column:1/-1; }
  .stock-inbound td[data-stock-field="产品 / SKU"] { padding-right:44px!important; }
  .stock-panel td[data-stock-field="选择"] { grid-row:1; grid-column:4; text-align:right; align-self:center; z-index:1; }
  .stock-panel td[data-stock-field="选择"] input { width:24px; height:24px; margin:6px; }
  .stock-panel td[data-stock-field]::before { content:attr(data-stock-field); display:block; color:#536a5b; font-size:12px; margin-bottom:4px; }
  .stock-panel td:is([data-stock-field="产品 / SKU"],[data-stock-field="选择"],[data-stock-field="操作"])::before { display:none; }
  .stock-panel td:is([data-stock-field="本次入库数量"],[data-stock-field="操作"],[data-stock-field="采购物流"]) { grid-column:1/-1; }
  .stock-panel td[data-stock-field="本次入库数量"] { display:flex; align-items:center; gap:10px; width:auto; }
  .stock-panel td[data-stock-field="本次入库数量"]::before { margin:0; }
  .stock-panel .stock-product { min-width:0; }
}
