/* v64 phone inventory grid: five compact cards per row (four below 360px).
 * Only when "卡片详情" is off; the detailed card layout keeps its own grid. */
@media(max-width:700px){
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card{position:relative;min-width:0;min-height:0!important;padding:16px 2px 5px!important;border-radius:10px!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-actions{position:absolute!important;inset:2px 2px auto 2px;display:flex!important;justify-content:space-between;align-items:center;height:14px;margin:0!important;padding:0!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-actions input[type=checkbox]{width:13px!important;height:13px!important;margin:0!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .favorite-button{min-width:0!important;min-height:0!important;width:16px;height:16px;padding:0!important;font-size:13px!important;line-height:16px!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .hidden-badge{display:none}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-open{gap:1px!important;min-width:0;padding:0!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-open img{width:34px!important;height:34px!important;margin:0 auto!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px!important;line-height:1.3!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .aggregate-quantity{font-size:14px!important;line-height:1.2!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .item-open .muted{display:none!important}
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-card .compact-stock-status{margin-top:2px!important;padding-top:2px!important;font-size:9.5px!important;line-height:1.2!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:359px){
 html body.farm-ui[data-density]:not([data-card-details="true"]) #workspace .aggregate-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

/* Item names on inventory cards: bold everywhere, larger on desktop. */
html body.farm-ui[data-density] #workspace .aggregate-card .item-name{font-weight:700!important;color:var(--deep,#273d35)}
@media(min-width:701px){
 html body.farm-ui[data-density] #workspace .aggregate-card .item-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px!important;line-height:1.35!important}
}

/* v67 "较上次" chip: centred in the card's top row between the checkbox and the star. */
.delta-chip{display:inline-flex;align-items:center;justify-content:center;min-width:0;max-width:100%;padding:0 6px;border-radius:999px;font-size:11px;font-weight:800;line-height:17px;white-space:nowrap;font-variant-numeric:tabular-nums}
.delta-chip.is-up{background:#e3f4e7;color:#1f7a3a}
.delta-chip.is-down{background:#fde7e6;color:#c0392b}
.delta-chip.is-partial{outline:1px dashed currentColor;outline-offset:-1px}
.delta-chip .delta-short{display:none}
html body.farm-ui[data-density] #workspace .aggregate-card .item-actions{display:flex;align-items:center;justify-content:space-between;gap:4px}
html body.farm-ui[data-density] #workspace .aggregate-card .item-actions .delta-chip{flex:0 1 auto;margin:0 auto}
@media(max-width:700px){
 html body.farm-ui[data-density] #workspace .aggregate-card .delta-chip{padding:0 3px;font-size:9px;line-height:13px}
 html body.farm-ui[data-density] #workspace .aggregate-card .delta-chip .delta-full{display:none}
 html body.farm-ui[data-density] #workspace .aggregate-card .delta-chip .delta-short{display:inline}
}

/* v68 target meter: 现有/目标 + bar; cards without a target have no status line. */
html body.farm-ui[data-density] #workspace .aggregate-card .compact-stock-status.target-meter{display:flex;flex-direction:column;align-items:stretch;gap:3px;font-weight:700;font-variant-numeric:tabular-nums}
.target-meter .tm-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
.target-meter .tm-short{display:none}
.target-meter .tm-bar{display:block;height:4px;border-radius:999px;background:color-mix(in srgb,currentColor 16%,transparent);overflow:hidden}
.target-meter .tm-bar i{display:block;height:100%;border-radius:inherit;background:currentColor}
html body.farm-ui[data-density] #workspace .target-meter.is-ok{color:#1f7a3a!important}
html body.farm-ui[data-density] #workspace .target-meter.is-short{color:#c0392b!important}
html body.farm-ui[data-density] #workspace .target-meter.is-review{color:#a66d10!important}
@media(max-width:700px){
 .target-meter .tm-full{display:none}
 .target-meter .tm-short{display:inline}
 html body.farm-ui[data-density] #workspace .aggregate-card .compact-stock-status.target-meter{gap:2px}
 .target-meter .tm-bar{height:3px}
}
